php-src/Zend/tests/ns_055.phpt

29 lines
359 B
Plaintext
Raw Normal View History

2007-11-09 13:34:58 +00:00
--TEST--
055: typehints in namespaces
--FILE--
<?php
namespace test\ns1;
2007-11-09 13:34:58 +00:00
class Foo {
function test1(Foo $x) {
echo "ok\n";
}
function test2(\test\ns1\Foo $x) {
2007-11-09 13:34:58 +00:00
echo "ok\n";
}
function test3(\Exception $x) {
2007-11-09 13:34:58 +00:00
echo "ok\n";
}
}
$foo = new Foo();
$ex = new \Exception();
2007-11-09 13:34:58 +00:00
$foo->test1($foo);
$foo->test2($foo);
$foo->test3($ex);
?>
--EXPECT--
ok
ok
ok