Skip to content

Commit

Permalink
Add test for phpGH-17101
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsdos committed Dec 12, 2024
1 parent 17d1e17 commit 5e2c697
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Zend/tests/property_hooks/gh17101.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--TEST--
GH-17101 (AST->string does not reproduce constructor property promotion correctly)
--FILE--
<?php

try {
assert(false && new class {
public function __construct( #[Foo] public private(set) bool $boolVal = false { final set => $this->boolVal = 1;} ) {}
});
} catch (Error $e) {
echo $e->getMessage(), "\n";
}

?>
--EXPECT--
assert(false && new class {
public function __construct(#[Foo] public private(set) bool $boolVal = false {
final set => $this->boolVal = 1;
}) {
}

})

0 comments on commit 5e2c697

Please sign in to comment.