php-src/Zend/tests/ns_074.phpt

25 lines
320 B
Plaintext
Raw Normal View History

2008-11-10 11:39:57 +00:00
--TEST--
Testing type-hinted lambda parameter inside namespace
--FILE--
<?php
namespace foo;
$x = function (\stdclass $x = NULL) {
var_dump($x);
};
class stdclass extends \stdclass { }
2008-11-10 11:39:57 +00:00
$x(NULL);
$x(new stdclass);
$x(new \stdclass);
2008-11-10 11:39:57 +00:00
?>
--EXPECTF--
NULL
object(foo\stdclass)#%d (0) {
2008-11-10 11:39:57 +00:00
}
object(stdClass)#%d (0) {
2008-11-10 11:39:57 +00:00
}