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