mirror of
https://github.com/php/php-src.git
synced 2024-12-15 04:45:03 +08:00
1b4134c07b
[DOC] new resolution rules should be documented soon
29 lines
359 B
PHP
Executable File
29 lines
359 B
PHP
Executable File
--TEST--
|
|
055: typehints in namespaces
|
|
--FILE--
|
|
<?php
|
|
namespace test\ns1;
|
|
|
|
class Foo {
|
|
function test1(Foo $x) {
|
|
echo "ok\n";
|
|
}
|
|
function test2(\test\ns1\Foo $x) {
|
|
echo "ok\n";
|
|
}
|
|
function test3(\Exception $x) {
|
|
echo "ok\n";
|
|
}
|
|
}
|
|
|
|
$foo = new Foo();
|
|
$ex = new \Exception();
|
|
$foo->test1($foo);
|
|
$foo->test2($foo);
|
|
$foo->test3($ex);
|
|
?>
|
|
--EXPECT--
|
|
ok
|
|
ok
|
|
ok
|