2020-07-09 09:11:24 +00:00
|
|
|
--TEST--
|
|
|
|
Bug #79599 (coredump in set_error_handler)
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
set_error_handler(function($code, $message){
|
2020-09-18 12:28:32 +00:00
|
|
|
throw new \Exception($message);
|
2020-07-09 09:11:24 +00:00
|
|
|
});
|
|
|
|
function test1(){
|
2020-09-18 12:28:32 +00:00
|
|
|
$a[] = $b;
|
2020-07-09 09:11:24 +00:00
|
|
|
}
|
|
|
|
function test2(){
|
2020-09-18 12:28:32 +00:00
|
|
|
$a[$c] = $b;
|
2020-07-09 09:11:24 +00:00
|
|
|
}
|
|
|
|
try{
|
2020-09-18 12:28:32 +00:00
|
|
|
test1();
|
2020-07-09 09:11:24 +00:00
|
|
|
}catch(\Exception $e){
|
2020-09-18 12:28:32 +00:00
|
|
|
var_dump($e->getMessage());
|
2020-07-09 09:11:24 +00:00
|
|
|
}
|
|
|
|
try{
|
2020-09-18 12:28:32 +00:00
|
|
|
test2();
|
2020-07-09 09:11:24 +00:00
|
|
|
}catch(\Exception $e){
|
2020-09-18 12:28:32 +00:00
|
|
|
var_dump($e->getMessage());
|
2020-07-09 09:11:24 +00:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
--EXPECT--
|
2020-07-09 09:13:50 +00:00
|
|
|
string(21) "Undefined variable $b"
|
|
|
|
string(21) "Undefined variable $c"
|