mirror of
https://github.com/php/php-src.git
synced 2024-11-26 03:16:33 +08:00
75742d57eb
this is a enhancement of the fix for bug #64135
65 lines
1.0 KiB
PHP
65 lines
1.0 KiB
PHP
--TEST--
|
|
Exceptions before fatal error
|
|
--FILE--
|
|
<?php
|
|
function exception_error_handler($code, $msg) {
|
|
throw new Exception($msg);
|
|
}
|
|
|
|
set_error_handler("exception_error_handler");
|
|
|
|
try {
|
|
$foo->a();
|
|
} catch(Exception $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
|
|
try {
|
|
new $foo();
|
|
} catch(Exception $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
|
|
try {
|
|
throw $foo;
|
|
} catch(Exception $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
|
|
try {
|
|
$foo();
|
|
} catch(Exception $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
|
|
try {
|
|
$foo::b();
|
|
} catch(Exception $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
|
|
|
|
try {
|
|
$b = clone $foo;
|
|
} catch(Exception $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
|
|
class b {
|
|
}
|
|
|
|
try {
|
|
b::$foo();
|
|
} catch(Exception $e) {
|
|
var_dump($e->getMessage());
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
string(23) "Undefined variable: foo"
|
|
string(23) "Undefined variable: foo"
|
|
string(23) "Undefined variable: foo"
|
|
string(23) "Undefined variable: foo"
|
|
string(23) "Undefined variable: foo"
|
|
string(23) "Undefined variable: foo"
|
|
string(23) "Undefined variable: foo"
|