xref: /PHP-7.2/Zend/tests/ns_056.phpt (revision 610c7fbe)
1--TEST--
2056: type-hint compatibility in namespaces
3--SKIPIF--
4<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?>
5--FILE--
6<?php
7namespace test\ns1;
8use \SplObserver;
9
10class Foo implements SplObserver {
11	function update(\SplSubject $x) {
12		echo "ok\n";
13	}
14}
15
16class Bar implements \SplSubject {
17	function attach(SplObserver $x) {
18		echo "ok\n";
19	}
20	function notify() {
21	}
22	function detach(SplObserver $x) {
23	}
24}
25$foo = new Foo();
26$bar = new Bar();
27$bar->attach($foo);
28$foo->update($bar);
29?>
30--EXPECT--
31ok
32ok
33