Skip to content

Commit 6bf1d24

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fixed bug #81512 (Unexpected behavior with arrays and JIT)
2 parents 90ceac6 + b47a48f commit 6bf1d24

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

ext/opcache/tests/jit/bug81512.phpt

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--TEST--
2+
Bug #81512: Unexpected behavior with arrays and JIT
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
--FILE--
9+
<?php
10+
$pipe = [['val1'],['val2'],];
11+
12+
for ($i = 0; $i < 30; ++$i) {
13+
echo "$i ";
14+
if (!is_pipeline($pipe)) {
15+
echo 'ERROR ';
16+
}
17+
}
18+
19+
function is_pipeline($pipeline): bool {
20+
foreach ($pipeline as $stage) {
21+
if (!is_array($stage)) {
22+
return false; // must never happen
23+
}
24+
25+
$stage = (array) $stage;
26+
reset($stage);
27+
}
28+
29+
return true;
30+
}
31+
?>
32+
--EXPECT--
33+
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

0 commit comments

Comments
 (0)