Skip to content

Commit b6f17b4

Browse files
committed
Address review comments
1 parent 6e5749e commit b6f17b4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Zend/Optimizer/sccp.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -801,13 +801,10 @@ static inline zend_result ct_eval_array_key_exists(zval *result, zval *op1, zval
801801

802802
static bool can_ct_eval_func_call(zend_function *func, zend_string *name, uint32_t num_args, zval **args) {
803803
/* Precondition: func->type == ZEND_INTERNAL_FUNCTION, this is a global function */
804-
/* Functions in this list must always produce the same result for the same arguments,
804+
/* Functions setting ZEND_ACC_COMPILE_TIME_EVAL (@compile-time-eval) must always produce the same result for the same arguments,
805805
* and have no dependence on global state (such as locales). It is okay if they throw
806-
* or warn on invalid arguments, as we detect this and will discard the evaluation result.
807-
*
808-
* In PHP 8.2, many functions stopped depending on locales due to https://wiki.php.net/rfc/strtolower-ascii */
809-
zend_internal_function *internal_func = (zend_internal_function *)func;
810-
if (internal_func->fn_flags & ZEND_ACC_COMPILE_TIME_EVAL) {
806+
* or warn on invalid arguments, as we detect this and will discard the evaluation result. */
807+
if (func->common.fn_flags & ZEND_ACC_COMPILE_TIME_EVAL) {
811808
/* This has @compile-time-eval in stub info and uses a macro such as ZEND_SUPPORTS_COMPILE_TIME_EVAL_FE */
812809
return true;
813810
}

0 commit comments

Comments
 (0)