File tree 2 files changed +28
-3
lines changed
src/test/php/lang/ast/unittest/emit
2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,8 @@ XP Compiler ChangeLog
3
3
4
4
## ?.?.? / ????-??-??
5
5
6
- * Added PHP 8.4 emitter which feature-checks for both property hooks
7
- and asymmetric visibility RFCs, deciding whether to natively emit or
8
- use virtual properties
6
+ * Added PHP 8.4 emitter which natively emits property hooks and asymmetric
7
+ visibility syntax
9
8
(@thekid )
10
9
* Changed emitter to use native readonly classes in PHP 8.3, fixing an
11
10
inconsistency with accessing undefined properties
Original file line number Diff line number Diff line change
1
+ <?php namespace lang \ast \unittest \emit ;
2
+
3
+ use lang \ast \emit \Type ;
4
+ use test \{Assert , Test };
5
+
6
+ class PHP84Test extends EmittingTest {
7
+
8
+ /** @return string */
9
+ protected function runtime () { return 'php:8.4.0 ' ; }
10
+
11
+ #[Test]
12
+ public function property_hooks () {
13
+ Assert::matches (
14
+ '/\$test{get=>"Test";}/ ' ,
15
+ $ this ->emit ('class %T { public $test { get => "Test"; } } ' )
16
+ );
17
+ }
18
+
19
+ #[Test]
20
+ public function asymmetric_visibility () {
21
+ Assert::matches (
22
+ '/public private\(set\) string \$test/ ' ,
23
+ $ this ->emit ('class %T { public private(set) string $test; } ' )
24
+ );
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments