xref: /PHP-8.1/Zend/tests/ns_055.phpt (revision f8d79582)
1--TEST--
2055: types in namespaces
3--FILE--
4<?php
5namespace test\ns1;
6
7class Foo {
8    function test1(Foo $x) {
9        echo "ok\n";
10    }
11    function test2(\test\ns1\Foo $x) {
12        echo "ok\n";
13    }
14    function test3(\Exception $x) {
15        echo "ok\n";
16    }
17}
18
19$foo = new Foo();
20$ex = new \Exception();
21$foo->test1($foo);
22$foo->test2($foo);
23$foo->test3($ex);
24?>
25--EXPECT--
26ok
27ok
28ok
29