summaryrefslogtreecommitdiff
path: root/Zend/tests/ns_055.phpt
blob: a692e476014708d8f564c58a21aa9135e86346ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--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