From: Dmitry Stogov Date: Thu, 3 Sep 2020 07:49:58 +0000 (+0300) Subject: Fixed support for deprecated constants (Zend/tests/const_deprecation.phpt failure) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6b521a98d457ae4265f38a65861c723220256110;p=php Fixed support for deprecated constants (Zend/tests/const_deprecation.phpt failure) --- diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c index 09a9981184..88a4eeb369 100644 --- a/ext/opcache/jit/zend_jit_vm_helpers.c +++ b/ext/opcache/jit/zend_jit_vm_helpers.c @@ -272,6 +272,13 @@ static zend_always_inline int _zend_quick_get_constant( if (!check_defined_only) { ZVAL_COPY_OR_DUP(EX_VAR(opline->result.var), &c->value); + if (ZEND_CONSTANT_FLAGS(c) & CONST_DEPRECATED) { + zend_error(E_DEPRECATED, "Constant %s is deprecated", ZSTR_VAL(c->name)); + if (EG(exception)) { + return FAILURE; + } + return SUCCESS; + } } CACHE_PTR(opline->extended_value, c);