diff --git a/ChangeLog.md b/ChangeLog.md index 83ba14b2..3166c6e7 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,9 +3,8 @@ XP Compiler ChangeLog ## ?.?.? / ????-??-?? -* Added PHP 8.4 emitter which feature-checks for both property hooks - and asymmetric visibility RFCs, deciding whether to natively emit or - use virtual properties +* Added PHP 8.4 emitter which natively emits property hooks and asymmetric + visibility syntax (@thekid) * Changed emitter to use native readonly classes in PHP 8.3, fixing an inconsistency with accessing undefined properties diff --git a/src/test/php/lang/ast/unittest/emit/PHP84Test.class.php b/src/test/php/lang/ast/unittest/emit/PHP84Test.class.php new file mode 100755 index 00000000..69c55acd --- /dev/null +++ b/src/test/php/lang/ast/unittest/emit/PHP84Test.class.php @@ -0,0 +1,26 @@ +"Test";}/', + $this->emit('class %T { public $test { get => "Test"; } }') + ); + } + + #[Test] + public function asymmetric_visibility() { + Assert::matches( + '/public private\(set\) string \$test/', + $this->emit('class %T { public private(set) string $test; }') + ); + } +} \ No newline at end of file