diff options
author | Dmitry Stogov <dmitry@php.net> | 2007-11-09 13:34:39 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2007-11-09 13:34:39 +0000 |
commit | 8646d9afce989718cde927c526684bbbc1c96e97 (patch) | |
tree | 6df3ed493b06a1dfa41b96751bb5a3640fb67455 /Zend/tests/ns_056.phpt | |
parent | 98b3c247a88e9a2f14b25e859c4048a9e16a2a08 (diff) | |
download | php-git-8646d9afce989718cde927c526684bbbc1c96e97.tar.gz |
Fixed type-hint compatibility check in namespaces
Diffstat (limited to 'Zend/tests/ns_056.phpt')
-rwxr-xr-x | Zend/tests/ns_056.phpt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Zend/tests/ns_056.phpt b/Zend/tests/ns_056.phpt new file mode 100755 index 0000000000..0bc4f0087d --- /dev/null +++ b/Zend/tests/ns_056.phpt @@ -0,0 +1,31 @@ +--TEST-- +056: type-hint compatibility in namespaces +--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 |