From cb181c512ad5e4babe9e481d8d06080ae6be4f6d Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 27 Feb 2014 23:51:00 +0400 Subject: [PATCH] I don't know how to fix it --- Zend/zend_compile.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.40.0