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;
}
}
}
- 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;
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));