Skip to content

Commit 53dcff8

Browse files
committed
Test nested new
No reason it shouldn't work, but let's cover it anyway.
1 parent 2af82bf commit 53dcff8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Zend/tests/constexpr/new_arg_eval.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ function test(
1515
}
1616
test();
1717

18+
// Check that nested new works as well.
19+
function test2($p = new C(new C(__FUNCTION__))) {
20+
var_dump($p);
21+
}
22+
test2();
23+
1824
?>
1925
--EXPECTF--
2026
object(C)#1 (1) {
@@ -29,3 +35,10 @@ object(C)#3 (1) {
2935
["x"]=>
3036
string(%d) "%snew_arg_eval.php"
3137
}
38+
object(C)#3 (1) {
39+
["x"]=>
40+
object(C)#2 (1) {
41+
["x"]=>
42+
string(5) "test2"
43+
}
44+
}

0 commit comments

Comments
 (0)