2014-04-19 20:01:16 +08:00
|
|
|
--TEST--
|
|
|
|
Catch method calls on non-objects raise recoverable errors
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
set_error_handler(function($code, $message) {
|
|
|
|
var_dump($code, $message);
|
|
|
|
});
|
|
|
|
|
|
|
|
$x= null;
|
2015-03-09 20:57:15 +08:00
|
|
|
try {
|
|
|
|
var_dump($x->method());
|
2015-05-17 05:49:14 +08:00
|
|
|
} catch (Error $e) {
|
2015-03-09 20:57:15 +08:00
|
|
|
var_dump($e->getCode(), $e->getMessage());
|
|
|
|
}
|
2014-04-19 20:01:16 +08:00
|
|
|
echo "Alive\n";
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
2015-07-04 06:28:11 +08:00
|
|
|
int(0)
|
2014-07-06 23:07:41 +08:00
|
|
|
string(%d) "Call to a member function method() on null"
|
2014-04-19 20:01:16 +08:00
|
|
|
Alive
|