bug79599.phpt 458 B

123456789101112131415161718192021222324252627
  1. --TEST--
  2. Bug #79599 (coredump in set_error_handler)
  3. --FILE--
  4. <?php
  5. set_error_handler(function($code, $message){
  6. throw new \Exception($message);
  7. });
  8. function test1(){
  9. $a[] = $b;
  10. }
  11. function test2(){
  12. $a[$c] = $b;
  13. }
  14. try{
  15. test1();
  16. }catch(\Exception $e){
  17. var_dump($e->getMessage());
  18. }
  19. try{
  20. test2();
  21. }catch(\Exception $e){
  22. var_dump($e->getMessage());
  23. }
  24. ?>
  25. --EXPECT--
  26. string(21) "Undefined variable $b"
  27. string(21) "Undefined variable $c"