mirror of
https://github.com/php/php-src.git
synced 2026-10-29 10:22:06 +08:00
Add directories for tests relating to - `break` statements - functions with by-ref returns - `class_exists()` - dynamic properties - error handlers - error suppression with `@` - `get_object_vars()` - `highlight_string()` and `highlight_file()` - interfaces - `is_callable()` - iterators - shutdown functions - streams As well as organizing a couple of tests into existing sub directories along the way Work towards GH-15631
28 lines
490 B
PHP
28 lines
490 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(\Throwable $e){
|
|
echo $e::class, ': ', $e->getMessage(), "\n";
|
|
}
|
|
try{
|
|
test2();
|
|
}catch(\Throwable $e){
|
|
echo $e::class, ': ', $e->getMessage(), "\n";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
Exception: Undefined variable $b
|
|
Exception: Undefined variable $c
|