From: Dmitry Stogov Date: Thu, 27 Feb 2014 19:51:00 +0000 (+0400) Subject: I don't know how to fix it X-Git-Tag: POST_PHPNG_MERGE~412^2~498^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb181c512ad5e4babe9e481d8d06080ae6be4f6d;p=php I don't know how to fix it --- diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 50283d16cc..c370a05189 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3865,7 +3865,13 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, con zval *old_constant; if ((old_constant = zend_hash_find(child_constants_table, hash_key->key)) != NULL) { - if (old_constant != parent_constant) { +//??? if (old_constant != parent_constant) { +//??? see Zend/tests/errmsg_025.phpt + if ((Z_TYPE_P(old_constant) != Z_TYPE_P(parent_constant)) || + (Z_TYPE_P(old_constant) == IS_LONG && Z_LVAL_P(old_constant) != Z_LVAL_P(parent_constant)) || + (Z_TYPE_P(old_constant) == IS_BOOL && Z_LVAL_P(old_constant) != Z_LVAL_P(parent_constant)) || + (Z_TYPE_P(old_constant) == IS_DOUBLE && Z_DVAL_P(old_constant) != Z_DVAL_P(parent_constant)) || + (Z_REFCOUNTED_P(old_constant) && Z_COUNTED_P(old_constant) != Z_COUNTED_P(parent_constant))) { zend_error_noreturn(E_COMPILE_ERROR, "Cannot inherit previously-inherited or override constant %s from interface %s", hash_key->key->val, iface->name->val); } return 0;