Advertisement
Guest User

huj z henka

a guest
Oct 22nd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <body>
  2. <?php
  3.  
  4. function iloraz($b)
  5. {
  6. if(!is_int($b))
  7. throw new invalidArgumentException();
  8. $a=100;
  9. $iloraz=$a/$b;
  10. echo "wynik dzielenia to" .$iloraz;
  11. }
  12.  
  13. try
  14. {
  15. $b='w';
  16. iloraz($b);
  17. }
  18. catch(exception $e)
  19. {
  20.  
  21. echo "wyjatek o kodzie ".$e->getCode()."<br>";
  22. echo "Komunikat wyjątku: ".$e->getMessage()."<br>";
  23. echo "Wyjatek jest w pliku o nazwie: ".$e->getFile()."<br>";
  24. echo"Wyjatek jest w lini nr : ".$e->getLine()."<br>";
  25. }
  26. ?>
  27. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement