cvs: ZendEngine2 / zend_compile.c /tests ns_054.phpt

From: Date: Fri, 09 Nov 2007 12:16:56 +0000
Subject: cvs: ZendEngine2 / zend_compile.c /tests ns_054.phpt
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-6142@lists.php.net to get a copy of this message
dmitry Fri Nov 9 12:16:56 2007 UTC Modified files: /ZendEngine2 zend_compile.c /ZendEngine2/tests ns_054.phpt Log: Fixed implementation of internal interfaces in namespaces http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.778&r2=1.779&diff_format=u Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.778 ZendEngine2/zend_compile.c:1.779 --- ZendEngine2/zend_compile.c:1.778 Tue Nov 6 07:29:41 2007 +++ ZendEngine2/zend_compile.c Fri Nov 9 12:16:55 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.778 2007/11/06 07:29:41 dmitry Exp $ */ +/* $Id: zend_compile.c,v 1.779 2007/11/09 12:16:55 dmitry Exp $ */ #include <zend_language_parser.h> #include "zend.h" @@ -3349,7 +3349,7 @@ 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; http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/ns_054.phpt?r1=1.1&r2=1.2&diff_format=u Index: ZendEngine2/tests/ns_054.phpt diff -u /dev/null ZendEngine2/tests/ns_054.phpt:1.2 --- /dev/null Fri Nov 9 12:16:56 2007 +++ ZendEngine2/tests/ns_054.phpt Fri Nov 9 12:16:55 2007 @@ -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

« previous php.zend-engine.cvs (#6142) next »