Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body>
- <?php
- function iloraz($b)
- {
- if(!is_int($b))
- throw new invalidArgumentException();
- $a=100;
- $iloraz=$a/$b;
- echo "wynik dzielenia to" .$iloraz;
- }
- try
- {
- $b='w';
- iloraz($b);
- }
- catch(exception $e)
- {
- echo "wyjatek o kodzie ".$e->getCode()."<br>";
- echo "Komunikat wyjątku: ".$e->getMessage()."<br>";
- echo "Wyjatek jest w pliku o nazwie: ".$e->getFile()."<br>";
- echo"Wyjatek jest w lini nr : ".$e->getLine()."<br>";
- }
- ?>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement