diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c index c4f169f811643..7ff691b3c9b4b 100644 --- a/ext/opcache/jit/zend_jit.c +++ b/ext/opcache/jit/zend_jit.c @@ -4785,12 +4785,12 @@ ZEND_EXT_API int zend_jit_config(zend_string *jit, int stage) return FAILURE; } - if (ZSTR_LEN(jit) == 0 - || zend_string_equals_literal_ci(jit, "disable")) { + if (zend_string_equals_literal_ci(jit, "disable")) { JIT_G(enabled) = 0; JIT_G(on) = 0; return SUCCESS; - } else if (zend_string_equals_literal_ci(jit, "0") + } else if (ZSTR_LEN(jit) == 0 + || zend_string_equals_literal_ci(jit, "0") || zend_string_equals_literal_ci(jit, "off") || zend_string_equals_literal_ci(jit, "no") || zend_string_equals_literal_ci(jit, "false")) { diff --git a/ext/opcache/tests/jit/gh14267_001.phpt b/ext/opcache/tests/jit/gh14267_001.phpt new file mode 100644 index 0000000000000..52be177b91550 --- /dev/null +++ b/ext/opcache/tests/jit/gh14267_001.phpt @@ -0,0 +1,16 @@ +--TEST-- +GH-14267: JIT cannot be enabled at runtime +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.jit=off +opcache.jit_buffer_size=32M +--EXTENSIONS-- +opcache +--FILE-- + +===DONE=== +--EXPECT-- +===DONE=== diff --git a/ext/opcache/tests/jit/gh14267_002.phpt b/ext/opcache/tests/jit/gh14267_002.phpt new file mode 100644 index 0000000000000..6151a42c71417 --- /dev/null +++ b/ext/opcache/tests/jit/gh14267_002.phpt @@ -0,0 +1,15 @@ +--TEST-- +GH-14267: JIT cannot be enabled at runtime +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.jit=disable +opcache.jit_buffer_size=32M +--EXTENSIONS-- +opcache +--FILE-- + +--EXPECTF-- +Warning: Cannot change opcache.jit setting at run-time (JIT is disabled) in %s on line %d