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