Skip to content

Commit d477822

Browse files
committed
Add test for GH-17101
1 parent 3f0f7ab commit d477822

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
GH-17101 (AST->string does not reproduce constructor property promotion correctly)
3+
--FILE--
4+
<?php
5+
6+
try {
7+
assert(false && new class {
8+
public function __construct( #[Foo] public private(set) bool $boolVal = false { final set => $this->boolVal = 1;} ) {}
9+
});
10+
} catch (Error $e) {
11+
echo $e->getMessage(), "\n";
12+
}
13+
14+
?>
15+
--EXPECT--
16+
assert(false && new class {
17+
public function __construct(#[Foo] public private(set) bool $boolVal = false {
18+
final set => $this->boolVal = 1;
19+
}) {
20+
}
21+
22+
})

0 commit comments

Comments
 (0)