summaryrefslogtreecommitdiff
path: root/Zend/tests/methods-on-non-objects-catch.phpt
blob: a52d3a722a6ba13603fd4225a38abc3dd721bcc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--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());
}
echo "Alive\n";
?>
--EXPECTF--
int(0)
string(%d) "Call to a member function method() on null"
Alive