1--TEST-- 2GH-17101 (AST->string does not reproduce constructor property promotion correctly) 3--FILE-- 4<?php 5 6try { 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-- 16assert(false && new class { 17 public function __construct(#[Foo] public private(set) bool $boolVal = false { 18 final set => $this->boolVal = 1; 19 }) { 20 } 21 22}) 23