bug33771.phpt 605 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. Bug #33771 (error_reporting falls to 0 when @ was used inside try/catch block)
  3. --FILE--
  4. <?php
  5. error_reporting(E_ALL);
  6. var_dump(error_reporting());
  7. function make_exception()
  8. {
  9. throw new Exception();
  10. }
  11. function make_exception_and_change_err_reporting()
  12. {
  13. error_reporting(E_ALL & ~E_NOTICE);
  14. throw new Exception();
  15. }
  16. try {
  17. @make_exception();
  18. } catch (Exception $e) {}
  19. var_dump(error_reporting());
  20. try {
  21. @make_exception_and_change_err_reporting();
  22. } catch (Exception $e) {}
  23. var_dump(error_reporting());
  24. echo "Done\n";
  25. ?>
  26. --EXPECT--
  27. int(32767)
  28. int(32767)
  29. int(32759)
  30. Done