phpist

Untitled

Oct 28th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. Листинг 26.12. Вывод сведений об исключении. Файл tostring.php
  2. <?php ## Вывод сведений об исключении
  3. function test($n)
  4. {
  5. $e = new Exception("bang-bang #$n!");
  6. echo "<pre>", $e, "</pre>";
  7. }
  8. function outer() { test(101); }
  9. outer();
  10. ?>
  11. Выводимый текст будет примерно следующим:
  12. exception 'Exception' with message 'bang-bang #101!' in tostring.php:3
  13. Stack trace:
  14. #0 tostring.php(6): test(101)
  15. #1 tostring.php(7): outer()
  16. #2 {main}
Advertisement
Add Comment
Please, Sign In to add comment