cvs: ZendEngine2 / zend_compile.c
| From: | Andi Gutmans | Date: | Sun, 29 Feb 2004 18:25:50 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2425@lists.php.net to get a copy of this message | ||
andi Sun Feb 29 13:25:50 2004 EDT
Modified files:
/ZendEngine2 zend_compile.c
Log:
- Change prototype isA check not to check the constructor.
- Only give an E_STRICT for non-isA compliant code as opposed to
E_COMPILE_ERROR.
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.548&r2=1.549&ty=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.548 ZendEngine2/zend_compile.c:1.549
--- ZendEngine2/zend_compile.c:1.548 Fri Feb 27 04:14:55 2004
+++ ZendEngine2/zend_compile.c Sun Feb 29 13:25:50 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.548 2004/02/27 09:14:55 helly Exp $ */
+/* $Id: zend_compile.c,v 1.549 2004/02/29 18:25:50 andi Exp $ */
#include "zend_language_parser.h"
#include "zend.h"
@@ -1713,7 +1713,8 @@
zend_uint i;
zend_function *proto = fe->common.prototype;
- if (!proto || !proto->common.arg_info) {
+ /* If it's a user function then arg_info == NULL means we don't have any parameters but
we still need to do the arg number checks. We are only willing to ignore this for internal
functions because extensions don't always define arg_info. */
+ if (!proto || (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION))
{
return 1;
}
@@ -1814,22 +1815,16 @@
}
}
- if (EG(ze1_compatibility_mode)) {
- if (parent_flags & ZEND_ACC_ABSTRACT) {
- child->common.prototype = parent;
- child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
- } else {
- child->common.prototype = parent->common.prototype;
- }
- } else {
- child->common.prototype = parent;
- if (parent_flags & ZEND_ACC_ABSTRACT) {
- child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
- }
+ child->common.prototype = parent;
+ if (parent_flags & ZEND_ACC_ABSTRACT) {
+ child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
}
- if (!zend_do_perform_implementation_check(child)) {
- zend_error(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with that of
%s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name,
ZEND_FN_SCOPE_NAME(child->common.prototype),
child->common.prototype->common.function_name);
+ /* Check E_STRICT before the check so that we save some time */
+ if(EG(error_reporting) & E_STRICT) {
+ if (!(child->common.fn_flags & ZEND_ACC_CTOR) &&
!zend_do_perform_implementation_check(child)) {
+ zend_error(E_STRICT, "Declaration of %s::%s() must be compatible with that of
%s::%s()", ZEND_FN_SCOPE_NAME(child), child->common.function_name,
ZEND_FN_SCOPE_NAME(child->common.prototype),
child->common.prototype->common.function_name);
+ }
}
return 0;
@@ -3406,7 +3401,7 @@
do_end_loop(foreach_token->u.opline_num TSRMLS_CC);
- zend_stack_top(&CG(foreach_copy_stack), &container_ptr);
+ zend_stack_top(&CG(foreach_copy_stack), (void **) &container_ptr);
generate_free_foreach_copy(container_ptr TSRMLS_CC);
zend_stack_del_top(&CG(foreach_copy_stack));