Skip to content

Commit 92b9543

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Fix enabling of JIT at runtime
2 parents c265b90 + 706e797 commit 92b9543

File tree

3 files changed

+34
-3
lines changed

3 files changed

+34
-3
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3364,12 +3364,12 @@ ZEND_EXT_API int zend_jit_config(zend_string *jit, int stage)
33643364
return FAILURE;
33653365
}
33663366

3367-
if (ZSTR_LEN(jit) == 0
3368-
|| zend_string_equals_literal_ci(jit, "disable")) {
3367+
if (zend_string_equals_literal_ci(jit, "disable")) {
33693368
JIT_G(enabled) = 0;
33703369
JIT_G(on) = 0;
33713370
return SUCCESS;
3372-
} else if (zend_string_equals_literal_ci(jit, "0")
3371+
} else if (ZSTR_LEN(jit) == 0
3372+
|| zend_string_equals_literal_ci(jit, "0")
33733373
|| zend_string_equals_literal_ci(jit, "off")
33743374
|| zend_string_equals_literal_ci(jit, "no")
33753375
|| zend_string_equals_literal_ci(jit, "false")) {
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
GH-14267: JIT cannot be enabled at runtime
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.jit=off
7+
opcache.jit_buffer_size=32M
8+
--EXTENSIONS--
9+
opcache
10+
--FILE--
11+
<?php
12+
ini_set('opcache.jit', 'tracing');
13+
?>
14+
===DONE===
15+
--EXPECT--
16+
===DONE===
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
--TEST--
2+
GH-14267: JIT cannot be enabled at runtime
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.jit=disable
7+
opcache.jit_buffer_size=32M
8+
--EXTENSIONS--
9+
opcache
10+
--FILE--
11+
<?php
12+
ini_set('opcache.jit', 'tracing');
13+
?>
14+
--EXPECTF--
15+
Warning: Cannot change opcache.jit setting at run-time (JIT is disabled) in %s on line %d

0 commit comments

Comments
 (0)