xref: /PHP-8.1/Zend/tests/ns_074.phpt (revision f8d79582)
1--TEST--
2Testing type-hinted lambda parameter inside namespace
3--FILE--
4<?php
5
6namespace foo;
7
8$x = function (\stdclass $x = NULL) {
9    var_dump($x);
10};
11
12class stdclass extends \stdclass { }
13
14$x(NULL);
15$x(new stdclass);
16$x(new \stdclass);
17
18?>
19--EXPECTF--
20NULL
21object(foo\stdclass)#%d (0) {
22}
23object(stdClass)#%d (0) {
24}
25