error_reporting03.phpt 494 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. testing @ and error_reporting - 3
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL & ~E_DEPRECATED);
  6. function foo($arg) {
  7. echo @$nonex_foo;
  8. }
  9. function bar() {
  10. echo @$nonex_bar;
  11. throw new Exception("test");
  12. }
  13. function foo1() {
  14. echo $undef1;
  15. error_reporting(E_ALL);
  16. echo $undef2;
  17. }
  18. try {
  19. @foo(@bar(@foo1()));
  20. } catch (Exception $e) {
  21. }
  22. var_dump(error_reporting());
  23. echo "Done\n";
  24. ?>
  25. --EXPECTF--
  26. Warning: Undefined variable $undef2 in %s on line %d
  27. int(32767)
  28. Done