summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-04-01 13:06:38 +0800
committerXinchen Hui <laruence@php.net>2015-04-01 13:06:38 +0800
commitfd0baec2e9afbd6706f16c26d32ec038c192d7e5 (patch)
tree0ba31b7242cc63451c84fb9fbb1172bffa9314e9 /Zend/zend_compile.c
parentaf812eac4c9727bdfb90cac1a35ab53d741cb7eb (diff)
parented772e1a998ca72fc1c354fcefc05149ca7a2a56 (diff)
downloadphp-git-fd0baec2e9afbd6706f16c26d32ec038c192d7e5.tar.gz
Merge branch 'master' of https://git.php.net/repository/php-src
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 2a76ff39e6..b1dcfcd66b 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3171,7 +3171,7 @@ void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type) /* {{
}
/* }}} */
-zend_bool zend_is_constructor(zend_string *name) /* {{{ */
+static zend_bool zend_is_constructor(zend_string *name) /* {{{ */
{
return zend_string_equals_literal_ci(name, ZEND_CONSTRUCTOR_FUNC_NAME);
}
@@ -4409,10 +4409,6 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo
ce->constructor = (zend_function *) op_array;
}
} else if (zend_string_equals_literal(lcname, ZEND_CONSTRUCTOR_FUNC_NAME)) {
- if (CG(active_class_entry)->constructor) {
- zend_error(E_STRICT, "Redefining already defined constructor for class %s",
- ce->name->val);
- }
ce->constructor = (zend_function *) op_array;
} else if (zend_string_equals_literal(lcname, ZEND_DESTRUCTOR_FUNC_NAME)) {
ce->destructor = (zend_function *) op_array;
@@ -4951,6 +4947,11 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */
zend_compile_stmt(stmt_ast);
+ if (ce->num_traits == 0) {
+ /* For traits this check is delayed until after trait binding */
+ zend_check_deprecated_constructor(ce);
+ }
+
if (ce->constructor) {
ce->constructor->common.fn_flags |= ZEND_ACC_CTOR;
if (ce->constructor->common.fn_flags & ZEND_ACC_STATIC) {