php-src/Zend/tests/methods-on-non-objects-nested-calls-ns.phpt

27 lines
539 B
Plaintext
Raw Normal View History

--TEST--
Catch method calls on non-objects with nested calls to namespaced functions with core counterparts
--FILE--
<?php namespace test;
function strlen($str) {
throw new LogicException('Should not be called');
}
set_error_handler(function($code, $message) {
static $i= 0;
echo 'Called #'.(++$i)."\n";
});
$x= null;
var_dump($x->method(strlen('Test')));
var_dump($x->method(strlen('Test'), strlen('Test')));
2014-07-06 14:40:21 +00:00
var_dump($x->method([strlen('Test')]));
echo "Alive\n";
?>
--EXPECTF--
Called #1
NULL
Called #2
NULL
2014-07-06 14:40:21 +00:00
Called #3
NULL
Alive