1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 17:43:13 +02:00
Files
archived-php-src/Zend/tests/bug79599.phpt
Nikita Popov 5795dfda93 Fix bug #79599 in a different way
Move the emission of the undefined variable notice before the
array separation.
2020-07-09 11:12:44 +02:00

28 lines
437 B
PHP

--TEST--
Bug #79599 (coredump in set_error_handler)
--FILE--
<?php
set_error_handler(function($code, $message){
throw new \Exception($message);
});
function test1(){
$a[] = $b;
}
function test2(){
$a[$c] = $b;
}
try{
test1();
}catch(\Exception $e){
var_dump($e->getMessage());
}
try{
test2();
}catch(\Exception $e){
var_dump($e->getMessage());
}
?>
--EXPECT--
string(21) "Undefined variable: b"
string(21) "Undefined variable: b"