cvs: ZendEngine2 / zend_API.c zend_compile.c
| From: | Marcus Boerger | Date: | Tue, 02 Sep 2003 13:26:26 +0000 |
| Subject: | cvs: ZendEngine2 / zend_API.c zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1790@lists.php.net to get a copy of this message | ||
helly Tue Sep 2 09:26:26 2003 EDT
Modified files:
/ZendEngine2 zend_API.c zend_compile.c
Log:
Currently we cannot support static ctor/dtor
Index: ZendEngine2/zend_API.c
diff -u ZendEngine2/zend_API.c:1.212 ZendEngine2/zend_API.c:1.213
--- ZendEngine2/zend_API.c:1.212 Fri Aug 29 19:27:22 2003
+++ ZendEngine2/zend_API.c Tue Sep 2 09:26:25 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_API.c,v 1.212 2003/08/29 23:27:22 helly Exp $ */
+/* $Id: zend_API.c,v 1.213 2003/09/02 13:26:25 helly Exp $ */
#include "zend.h"
#include "zend_execute.h"
@@ -1283,9 +1283,15 @@
scope->clone = clone;
if (ctor) {
ctor->common.fn_flags |= ZEND_ACC_CTOR;
+ if (ctor->common.fn_flags & ZEND_ACC_STATIC) {
+ zend_error(error_type, "Constructor %s::%s cannot be static",
ctor->common.scope->name, ctor->common.function_name);
+ }
}
if (dtor) {
dtor->common.fn_flags |= ZEND_ACC_DTOR;
+ if (dtor->common.fn_flags & ZEND_ACC_STATIC) {
+ zend_error(error_type, "Destructor %s::%s cannot be static",
dtor->common.scope->name, dtor->common.function_name);
+ }
}
}
return SUCCESS;
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.469 ZendEngine2/zend_compile.c:1.470
--- ZendEngine2/zend_compile.c:1.469 Fri Aug 29 04:51:43 2003
+++ ZendEngine2/zend_compile.c Tue Sep 2 09:26:25 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.469 2003/08/29 08:51:43 zeev Exp $ */
+/* $Id: zend_compile.c,v 1.470 2003/09/02 13:26:25 helly Exp $ */
#include "zend_language_parser.h"
#include "zend.h"
@@ -2277,9 +2277,15 @@
if (ce->constructor) {
ce->constructor->common.fn_flags |= ZEND_ACC_CTOR;
+ if (ce->constructor->common.fn_flags & ZEND_ACC_STATIC) {
+ zend_error(E_COMPILE_ERROR, "Constructor %s::%s cannot be static", ce->name,
ce->constructor->common.function_name);
+ }
}
if (ce->destructor) {
ce->destructor->common.fn_flags |= ZEND_ACC_DTOR;
+ if (ce->destructor->common.fn_flags & ZEND_ACC_STATIC) {
+ zend_error(E_COMPILE_ERROR, "Destructor %s::%s cannot be static", ce->name,
ce->destructor->common.function_name);
+ }
}
ce->line_end = zend_get_compiled_lineno(TSRMLS_C);