Skip to content

Commit 706e797

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix enabling of JIT at runtime
2 parents ad15517 + 9506ca6 commit 706e797

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 8.3.9
44

5+
- Opcache:
6+
. Fixed bug GH-14267 (opcache.jit=off does not allow enabling JIT at runtime).
7+
(ilutov)
8+
59
- SPL:
610
. Fixed bug GH-14290 (Member access within null pointer in extension spl).
711
(nielsdos)

ext/opcache/jit/zend_jit.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4803,12 +4803,12 @@ ZEND_EXT_API int zend_jit_config(zend_string *jit, int stage)
48034803
return FAILURE;
48044804
}
48054805

4806-
if (ZSTR_LEN(jit) == 0
4807-
|| zend_string_equals_literal_ci(jit, "disable")) {
4806+
if (zend_string_equals_literal_ci(jit, "disable")) {
48084807
JIT_G(enabled) = 0;
48094808
JIT_G(on) = 0;
48104809
return SUCCESS;
4811-
} else if (zend_string_equals_literal_ci(jit, "0")
4810+
} else if (ZSTR_LEN(jit) == 0
4811+
|| zend_string_equals_literal_ci(jit, "0")
48124812
|| zend_string_equals_literal_ci(jit, "off")
48134813
|| zend_string_equals_literal_ci(jit, "no")
48144814
|| 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)