[php-src] PHP-8.6: Merge branch 'PHP-8.4' into PHP-8.5
| From: | David Carlier | Date: | Thu, 12 Nov 2026 13:20:56 +0000 |
| Subject: | [php-src] PHP-8.6: Merge branch 'PHP-8.4' into PHP-8.5 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-143632@lists.php.net to get a copy of this message | ||
Author: David Carlier (devnexen)
Date: 2026-11-12T13:18:29Z
Commit: https://github.com/php/php-src/commit/6021f295ebb77c8e926327b6705f95d29f598206
Raw diff: https://github.com/php/php-src/commit/6021f295ebb77c8e926327b6705f95d29f598206.diff
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
Fix GH-25359: tracing JIT drops reference type of a named by-ref argument
Changed paths:
A ext/opcache/tests/jit/gh25359.phpt
M ext/opcache/jit/zend_jit_trace.c
Diff:
diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c
index 7d85a4a88622..b7f98764649c 100644
--- a/ext/opcache/jit/zend_jit_trace.c
+++ b/ext/opcache/jit/zend_jit_trace.c
@@ -2388,6 +2388,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer,
uin
/* Add statically inferred restrictions */
if (ssa_ops[idx].op1_def >= 0) {
if (opline->opcode == ZEND_SEND_VAR_EX
+ && opline->op2_type != IS_CONST
&& frame
&& frame->call
&& frame->call->func
diff --git a/ext/opcache/tests/jit/gh25359.phpt b/ext/opcache/tests/jit/gh25359.phpt
new file mode 100644
index 000000000000..b9c011cea57b
--- /dev/null
+++ b/ext/opcache/tests/jit/gh25359.phpt
@@ -0,0 +1,27 @@
+--TEST--
+GH-25359 (Tracing JIT drops reference type of CV passed as a named by-ref argument)
+--EXTENSIONS--
+opcache
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.jit=tracing
+opcache.jit_hot_func=1
+--FILE--
+<?php
+namespace Test;
+function f(&$a = null, &$b = null) { $b++; }
+function g(int $s) {
+ f(b: $s);
+ return $s + 1;
+}
+for ($i = 0; $i < 5; $i++) {
+ var_dump(g(41));
+}
+?>
+--EXPECT--
+int(43)
+int(43)
+int(43)
+int(43)
+int(43)