php-src/Zend/tests/ns_056.phpt

33 lines
528 B
Plaintext
Raw Normal View History

--TEST--
056: type-hint compatibility in namespaces
--SKIPIF--
<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?>
--FILE--
<?php
2008-12-04 20:12:30 +00:00
namespace test\ns1;
use \SplObserver;
class Foo implements SplObserver {
2008-12-04 20:12:30 +00:00
function update(\SplSubject $x) {
echo "ok\n";
}
}
2008-12-04 20:12:30 +00:00
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