summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2007-11-09 12:15:41 +0000
committerDmitry Stogov <dmitry@php.net>2007-11-09 12:15:41 +0000
commit98b3c247a88e9a2f14b25e859c4048a9e16a2a08 (patch)
tree7ee969544ce18c9b0e0dceb7e1c348912930d0cc
parent4b731b1af05e1e5a7804c2dc02229632dfbc8ff5 (diff)
downloadphp-git-98b3c247a88e9a2f14b25e859c4048a9e16a2a08.tar.gz
Fixed implementation of internal interfaces in namesapces
-rwxr-xr-xZend/tests/ns_054.phpt31
-rw-r--r--Zend/zend_compile.c2
2 files changed, 32 insertions, 1 deletions
diff --git a/Zend/tests/ns_054.phpt b/Zend/tests/ns_054.phpt
new file mode 100755
index 0000000000..0eb9e0448f
--- /dev/null
+++ b/Zend/tests/ns_054.phpt
@@ -0,0 +1,31 @@
+--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
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index e4a38f3046..4d70797daa 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3136,7 +3136,7 @@ void zend_do_implements_interface(znode *interface_name TSRMLS_DC)
if (CG(active_op_array)->last > 0) {
opline = &CG(active_op_array)->opcodes[CG(active_op_array)->last-1];
if (opline->opcode == ZEND_FETCH_CLASS) {
- opline->extended_value = ZEND_FETCH_CLASS_INTERFACE;
+ opline->extended_value = (opline->extended_value & ~ZEND_FETCH_CLASS_MASK) | ZEND_FETCH_CLASS_INTERFACE;
}
}
break;