diff --git a/Zend/Optimizer/sccp.c b/Zend/Optimizer/sccp.c index 891b1f0982d5a..54333baaafc98 100644 --- a/Zend/Optimizer/sccp.c +++ b/Zend/Optimizer/sccp.c @@ -17,6 +17,7 @@ +----------------------------------------------------------------------+ */ +#include "php.h" #include "zend_API.h" #include "zend_exceptions.h" #include "zend_ini.h" @@ -908,6 +909,9 @@ static inline int ct_eval_func_call( ini_entry = zend_hash_find_ptr(EG(ini_directives), Z_STR_P(args[0])); if (!ini_entry) { + if (PG(enable_dl)) { + return FAILURE; + } ZVAL_FALSE(result); } else if (ini_entry->modifiable != ZEND_INI_SYSTEM) { return FAILURE; diff --git a/ext/opcache/tests/gh8466.phpt b/ext/opcache/tests/gh8466.phpt new file mode 100644 index 0000000000000..a85a39f549977 --- /dev/null +++ b/ext/opcache/tests/gh8466.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug GH-8466: ini_get() is optimized out when the option does not exist during compilation +--SKIPIF-- + +--FILE-- +