Merge branch 'PHP-8.4'

* PHP-8.4:
  opcache_get_configuration() properly reports jit_prof_threshold
This commit is contained in:
Christoph M. Becker 2024-12-09 11:47:26 +01:00
commit e5b4743d38
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
2 changed files with 20 additions and 1 deletions

View file

@ -0,0 +1,19 @@
--TEST--
opcache_get_configuration() properly reports jit_prof_threshold
--EXTENSIONS--
opcache
--SKIPIF--
<?php
if (!isset(opcache_get_configuration()["directives"]["opcache.jit_prof_threshold"])) die("skip no JIT");
?>
--FILE--
<?php
$expected = 1 / 128; // needs to be exactly representable as IEEE double
ini_set("opcache.jit_prof_threshold", $expected);
$actual = opcache_get_configuration()["directives"]["opcache.jit_prof_threshold"];
var_dump($actual);
var_dump($actual === $expected);
?>
--EXPECTF--
float(0.0078125)
bool(true)

View file

@ -848,7 +848,7 @@ ZEND_FUNCTION(opcache_get_configuration)
add_assoc_long(&directives, "opcache.jit_max_recursive_returns", JIT_G(max_recursive_returns)); add_assoc_long(&directives, "opcache.jit_max_recursive_returns", JIT_G(max_recursive_returns));
add_assoc_long(&directives, "opcache.jit_max_root_traces", JIT_G(max_root_traces)); add_assoc_long(&directives, "opcache.jit_max_root_traces", JIT_G(max_root_traces));
add_assoc_long(&directives, "opcache.jit_max_side_traces", JIT_G(max_side_traces)); add_assoc_long(&directives, "opcache.jit_max_side_traces", JIT_G(max_side_traces));
add_assoc_long(&directives, "opcache.jit_prof_threshold", JIT_G(prof_threshold)); add_assoc_double(&directives, "opcache.jit_prof_threshold", JIT_G(prof_threshold));
add_assoc_long(&directives, "opcache.jit_max_trace_length", JIT_G(max_trace_length)); add_assoc_long(&directives, "opcache.jit_max_trace_length", JIT_G(max_trace_length));
#endif #endif