]> granicus.if.org Git - php/commitdiff
Fixed support for deprecated constants (Zend/tests/const_deprecation.phpt failure)
authorDmitry Stogov <dmitry@zend.com>
Thu, 3 Sep 2020 07:49:58 +0000 (10:49 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 3 Sep 2020 07:49:58 +0000 (10:49 +0300)
ext/opcache/jit/zend_jit_vm_helpers.c

index 09a99811846f333f81f261e7ac4b9e9c7286bbd4..88a4eeb3690a4ddb7b5de9c05c3367bf74ec9939 100644 (file)
@@ -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);