cvs: ZendEngine2(PHP_5_1) / zend_compile.c /tests bug33732.phpt php-src NEWS
| From: | Dmitry Stogov | Date: | Wed, 23 Nov 2005 09:26:44 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_1) / zend_compile.c /tests bug33732.phpt php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4380@lists.php.net to get a copy of this message | ||
dmitry Wed Nov 23 04:26:44 2005 EDT
Added files: (Branch: PHP_5_1)
/ZendEngine2/tests bug33732.phpt
Modified files:
/php-src NEWS
/ZendEngine2 zend_compile.c
Log:
Bug #33732 (Wrong behavior of constants in class and interface extending)
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.2027.2.215&r2=1.2027.2.216&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.215 php-src/NEWS:1.2027.2.216
--- php-src/NEWS:1.2027.2.215 Tue Nov 22 22:13:57 2005
+++ php-src/NEWS Wed Nov 23 04:26:42 2005
@@ -11,6 +11,8 @@
on Linux). (Patch: shulmanb at il dot ibm dot com, Jani)
- Fixed bug #35143 (gettimeofday() ignores current time zone). (Derick)
- Fixed bug #35046 (phpinfo() uses improper css enclosure). (Ilia)
+- Fixed bug #33732 (Wrong behavior of constants in class and interface
+ extending). (Dmitry)
- Fixed bug #33153 (crash in mssql_next result). (Frank)
- Fixed bug #33963 (mssql_bind() fails on input parameters). (Frank)
- Fixed bug #33201 (Crash when fetching some data types). (Frank)
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.647.2.15&r2=1.647.2.16&ty=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.15 ZendEngine2/zend_compile.c:1.647.2.16
--- ZendEngine2/zend_compile.c:1.647.2.15 Tue Nov 22 14:46:13 2005
+++ ZendEngine2/zend_compile.c Wed Nov 23 04:26:43 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.647.2.15 2005/11/22 19:46:13 iliaa Exp $ */
+/* $Id: zend_compile.c,v 1.647.2.16 2005/11/23 09:26:43 dmitry Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -2208,10 +2208,14 @@
}
-static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zval *parent_constant,
zend_hash_key *hash_key, zend_class_entry *iface)
+static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zval
**parent_constant, zend_hash_key *hash_key, zend_class_entry *iface)
{
- if (zend_hash_quick_exists(child_constants_table, hash_key->arKey, hash_key->nKeyLength,
hash_key->h)) {
- zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited constant %s from interface
%s", hash_key->arKey, iface->name);
+ zval **old_constant;
+
+ if (zend_hash_quick_find(child_constants_table, hash_key->arKey, hash_key->nKeyLength,
hash_key->h, (void**)&old_constant) == SUCCESS) {
+ if (*old_constant != *parent_constant) {
+ zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited constant %s from interface
%s", hash_key->arKey, iface->name);
+ }
return 0;
}
return 1;
http://cvs.php.net/co.php/ZendEngine2/tests/bug33732.phpt?r=1.1&p=1
Index: ZendEngine2/tests/bug33732.phpt
+++ ZendEngine2/tests/bug33732.phpt