mirror of
https://github.com/php/php-src.git
synced 2024-12-18 22:41:20 +08:00
1b4134c07b
[DOC] new resolution rules should be documented soon
32 lines
500 B
PHP
Executable File
32 lines
500 B
PHP
Executable File
--TEST--
|
|
054: namespace and interfaces
|
|
--SKIPIF--
|
|
<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?>
|
|
--FILE--
|
|
<?php
|
|
namespace test\ns1;
|
|
|
|
class Foo implements \SplObserver {
|
|
function update(\SplSubject $x) {
|
|
echo "ok\n";
|
|
}
|
|
}
|
|
|
|
class Bar implements \SplSubject {
|
|
function attach(\SplObserver $x) {
|
|
echo "ok\n";
|
|
}
|
|
function notify() {
|
|
}
|
|
function detach(\SplObserver $x) {
|
|
}
|
|
}
|
|
$foo = new Foo();
|
|
$bar = new Bar();
|
|
$bar->attach($foo);
|
|
$foo->update($bar);
|
|
?>
|
|
--EXPECT--
|
|
ok
|
|
ok
|