Skip to content

Commit 7d8e3da

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: Fix null static_variable_ptr for uncalled fake closures
2 parents 2753b45 + 19063a8 commit 7d8e3da

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Zend/tests/gh8083.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
GH-8083 (var_dump() on closure with static variable segfaults)
3+
--FILE--
4+
<?php
5+
6+
function func() {
7+
static $i;
8+
}
9+
10+
$x = func(...);
11+
12+
var_dump($x);
13+
14+
?>
15+
--EXPECT--
16+
object(Closure)#1 (1) {
17+
["static"]=>
18+
array(1) {
19+
["i"]=>
20+
NULL
21+
}
22+
}

0 commit comments

Comments
 (0)