php-src/Zend/tests/ns_054.phpt

30 lines
477 B
Plaintext
Raw Normal View History

--TEST--
054: namespace and interfaces
--FILE--
<?php
2008-12-04 20:12:30 +00:00
namespace test\ns1;
2008-12-04 20:12:30 +00:00
class Foo implements \SplObserver {
function update(\SplSubject $x): void {
2020-02-03 21:52:20 +00:00
echo "ok\n";
}
}
2008-12-04 20:12:30 +00:00
class Bar implements \SplSubject {
function attach(\SplObserver $x): void {
2020-02-03 21:52:20 +00:00
echo "ok\n";
}
function notify(): void {
2020-02-03 21:52:20 +00:00
}
function detach(\SplObserver $x): void {
2020-02-03 21:52:20 +00:00
}
}
$foo = new Foo();
$bar = new Bar();
$bar->attach($foo);
$foo->update($bar);
?>
--EXPECT--
ok
ok