php-src/Zend/tests/methods-on-non-objects-catch.phpt

21 lines
372 B
Plaintext
Raw Normal View History

2014-04-19 12:01:16 +00: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;
try {
var_dump($x->method());
} catch (Error $e) {
var_dump($e->getCode(), $e->getMessage());
}
2014-04-19 12:01:16 +00:00
echo "Alive\n";
?>
--EXPECTF--
int(0)
string(%d) "Call to a member function method() on null"
2014-04-19 12:01:16 +00:00
Alive