cvs: ZendEngine2 / zend_compile.c
| From: | Marcus Boerger | Date: | Wed, 03 Sep 2003 19:28:47 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1804@lists.php.net to get a copy of this message | ||
helly Wed Sep 3 15:28:47 2003 EDT
Modified files:
/ZendEngine2 zend_compile.c
Log:
Cannot turn a static property into a non static one and vice versa
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.477 ZendEngine2/zend_compile.c:1.478
--- ZendEngine2/zend_compile.c:1.477 Wed Sep 3 14:01:22 2003
+++ ZendEngine2/zend_compile.c Wed Sep 3 15:28:46 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.477 2003/09/03 18:01:22 helly Exp $ */
+/* $Id: zend_compile.c,v 1.478 2003/09/03 19:28:46 helly Exp $ */
#include "zend_language_parser.h"
#include "zend.h"
@@ -1750,6 +1750,12 @@
}
if (zend_hash_quick_find(&ce->properties_info, hash_key->arKey, hash_key->nKeyLength,
hash_key->h, (void **) &child_info)==SUCCESS) {
+ if ((parent_info->flags & ZEND_ACC_STATIC) != (child_info->flags &
ZEND_ACC_STATIC)) {
+ zend_error(E_COMPILE_ERROR, "Cannot redeclare %s%s::$%s as %s%s::$%s",
+ (parent_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ",
parent_ce->name, hash_key->arKey,
+ (child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ",
ce->name, hash_key->arKey);
+
+ }
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags &
ZEND_ACC_PPP_MASK)) {
zend_error(E_COMPILE_ERROR, "Access level to %s::$%s must be %s (as in class %s)%s",
ce->name, hash_key->arKey, zend_visibility_string(parent_info->flags), parent_ce->name,
(parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
} else if (child_info->flags & ZEND_ACC_IMPLICIT_PUBLIC) {