1--TEST-- 2054: namespace and interfaces 3--FILE-- 4<?php 5namespace test\ns1; 6 7class Foo implements \SplObserver { 8 function update(\SplSubject $x): void { 9 echo "ok\n"; 10 } 11} 12 13class Bar implements \SplSubject { 14 function attach(\SplObserver $x): void { 15 echo "ok\n"; 16 } 17 function notify(): void { 18 } 19 function detach(\SplObserver $x): void { 20 } 21} 22$foo = new Foo(); 23$bar = new Bar(); 24$bar->attach($foo); 25$foo->update($bar); 26?> 27--EXPECT-- 28ok 29ok 30