mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
opcache_get_configuration() properly reports jit_prof_threshold
The `jit_prof_threshold` is a float, supposed to be in range [0, 1], and usually very small (the default is 0.005). Reporting it as int is meaningless. Closes GH-17077.
This commit is contained in:
parent
301b8e24c1
commit
3702f9783b
3 changed files with 23 additions and 1 deletions
3
NEWS
3
NEWS
|
@ -8,6 +8,9 @@ PHP NEWS
|
|||
- Iconv:
|
||||
. Fixed bug GH-17047 (UAF on iconv filter failure). (nielsdos)
|
||||
|
||||
- Opcache:
|
||||
. opcache_get_configuration() properly reports jit_prof_threshold. (cmb)
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug GH-17040 (SimpleXML's unset can break DOM objects). (nielsdos)
|
||||
|
||||
|
|
19
ext/opcache/tests/opcache_jit_prof_threshold.phpt
Normal file
19
ext/opcache/tests/opcache_jit_prof_threshold.phpt
Normal 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)
|
|
@ -849,7 +849,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_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_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));
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue