Skip to content

Commit 874f966

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Avoid JIT warning with opcache.jit_buffer_size=0
2 parents a831cbc + b49e178 commit 874f966

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3253,7 +3253,11 @@ static zend_result accel_post_startup(void)
32533253
|| zend_jit_startup(ZSMMG(reserved), jit_size, reattached) != SUCCESS) {
32543254
JIT_G(enabled) = false;
32553255
JIT_G(on) = false;
3256-
zend_accel_error(ACCEL_LOG_WARNING, "Could not enable JIT!");
3256+
/* The JIT is implicitly disabled with opcache.jit_buffer_size=0, so we don't want to
3257+
* emit a warning here. */
3258+
if (JIT_G(buffer_size) != 0) {
3259+
zend_accel_error(ACCEL_LOG_WARNING, "Could not enable JIT!");
3260+
}
32573261
}
32583262
}
32593263
#endif
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--TEST--
2+
JIT should not emit warning with opcache.jit_buffer_size=0
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.jit=tracing
7+
opcache.jit_buffer_size=0
8+
opcache.log_verbosity_level=2
9+
--EXTENSIONS--
10+
opcache
11+
--FILE--
12+
<?php
13+
var_dump(opcache_get_status()['jit']['enabled'] ?? false);
14+
?>
15+
--EXPECT--
16+
bool(false)

0 commit comments

Comments
 (0)