[php-src] master: Merge branch 'PHP-8.6'

From: Date: Thu, 22 Oct 2026 17:11:48 +0000
Subject: [php-src] master: Merge branch 'PHP-8.6'
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-142598@lists.php.net to get a copy of this message
Author: Jorg Sowa (jorgsowa) Date: 2026-10-22T19:09:08+02:00 Commit: https://github.com/php/php-src/commit/21c4370dfa51450262438691f87e2098fc2e7e2f Raw diff: https://github.com/php/php-src/commit/21c4370dfa51450262438691f87e2098fc2e7e2f.diff Merge branch 'PHP-8.6' # Conflicts: # NEWS Changed paths: A ext/opcache/tests/jit/assign_dim_op_008.phpt A ext/opcache/tests/jit/assign_dim_op_009.phpt A ext/opcache/tests/jit/assign_dim_op_010.phpt A ext/opcache/tests/jit/assign_dim_op_011.phpt A ext/opcache/tests/jit/assign_dim_op_012.phpt M ext/opcache/jit/zend_jit_ir.c Diff: diff --git a/ext/opcache/jit/zend_jit_ir.c b/ext/opcache/jit/zend_jit_ir.c index 15278b16f810..7243416469be 100644 --- a/ext/opcache/jit/zend_jit_ir.c +++ b/ext/opcache/jit/zend_jit_ir.c @@ -13937,6 +13937,9 @@ static int zend_jit_assign_dim_op(zend_jit_ctx *jit, ir_MERGE_list(end_inputs); } + if (op1_data_info & (MAY_BE_REF|MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) { + op1_data_info |= MAY_BE_RC1|MAY_BE_RCN; + } jit_FREE_OP(jit, (opline+1)->op1_type, (opline+1)->op1, op1_data_info, NULL); jit_FREE_OP(jit, opline->op2_type, opline->op2, op2_info, NULL); if (!op1_indirect) { diff --git a/ext/opcache/tests/jit/assign_dim_op_008.phpt b/ext/opcache/tests/jit/assign_dim_op_008.phpt new file mode 100644 index 000000000000..67179c0b1287 --- /dev/null +++ b/ext/opcache/tests/jit/assign_dim_op_008.phpt @@ -0,0 +1,21 @@ +--TEST-- +JIT ASSIGN_DIM_OP: CONCAT of a temporary string into a null element +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit=function +--FILE-- +<?php +function f($n) { + $arr = [5 => null]; + $arr[5] .= dechex($n); + return $arr; +} +var_dump(f(255)); +?> +--EXPECT-- +array(1) { + [5]=> + string(2) "ff" +} diff --git a/ext/opcache/tests/jit/assign_dim_op_009.phpt b/ext/opcache/tests/jit/assign_dim_op_009.phpt new file mode 100644 index 000000000000..479a4fa079c0 --- /dev/null +++ b/ext/opcache/tests/jit/assign_dim_op_009.phpt @@ -0,0 +1,19 @@ +--TEST-- +JIT ASSIGN_DIM_OP: CONCAT of a temporary string into a referenced null element +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit=function +--FILE-- +<?php +function f($n) { + $arr = [5 => null]; + $r = &$arr[5]; + $arr[5] .= dechex($n); + return $r; +} +var_dump(f(255)); +?> +--EXPECT-- +string(2) "ff" diff --git a/ext/opcache/tests/jit/assign_dim_op_010.phpt b/ext/opcache/tests/jit/assign_dim_op_010.phpt new file mode 100644 index 000000000000..2e50bef85771 --- /dev/null +++ b/ext/opcache/tests/jit/assign_dim_op_010.phpt @@ -0,0 +1,26 @@ +--TEST-- +JIT ASSIGN_DIM_OP: CONCAT of a temporary string into a typed reference +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit=function +--FILE-- +<?php +class C { + public ?string $p = null; +} +function f($n) { + $c = new C; + $arr = [5 => null]; + $arr[5] = &$c->p; + $arr[5] .= dechex($n); + return $c; +} +var_dump(f(255)); +?> +--EXPECT-- +object(C)#1 (1) { + ["p"]=> + string(2) "ff" +} diff --git a/ext/opcache/tests/jit/assign_dim_op_011.phpt b/ext/opcache/tests/jit/assign_dim_op_011.phpt new file mode 100644 index 000000000000..5f95a9111a96 --- /dev/null +++ b/ext/opcache/tests/jit/assign_dim_op_011.phpt @@ -0,0 +1,28 @@ +--TEST-- +JIT ASSIGN_DIM_OP: CONCAT of a temporary string into an ArrayAccess offset +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit=function +--FILE-- +<?php +class A implements ArrayAccess { + public $d = []; + function offsetGet($o): mixed { return $this->d[$o] ?? null; } + function offsetSet($o, $v): void { $this->d[$o] = $v; } + function offsetExists($o): bool { return isset($this->d[$o]); } + function offsetUnset($o): void {} +} +function f($n) { + $a = new A; + $a[5] .= dechex($n); + return $a->d; +} +var_dump(f(255)); +?> +--EXPECT-- +array(1) { + [5]=> + string(2) "ff" +} diff --git a/ext/opcache/tests/jit/assign_dim_op_012.phpt b/ext/opcache/tests/jit/assign_dim_op_012.phpt new file mode 100644 index 000000000000..e2f168708041 --- /dev/null +++ b/ext/opcache/tests/jit/assign_dim_op_012.phpt @@ -0,0 +1,26 @@ +--TEST-- +JIT ASSIGN_DIM_OP: ADD of a temporary array +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit=function +--FILE-- +<?php +function f($n) { + $arr = [5 => []]; + $arr[5] += $n ? [1, str_repeat("a", $n)] : 1; + return $arr; +} +var_dump(f(3)); +?> +--EXPECT-- +array(1) { + [5]=> + array(2) { + [0]=> + int(1) + [1]=> + string(3) "aaa" + } +}

« previous php.cvs (#142598) next »