File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/test/php/lang/ast/unittest/emit Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 6
6
/**
7
7
* Tests for first-class callable syntax
8
8
*
9
+ * @see https://wiki.php.net/rfc/fcc_in_const_expr
9
10
* @see https://wiki.php.net/rfc/first_class_callable_syntax#proposal
10
11
*/
11
12
class CallableSyntaxTest extends EmittingTest {
@@ -182,4 +183,16 @@ public function __construct($value) { $this->value= $value; }
182
183
} ' );
183
184
Assert::equals ($ this , $ f ($ this )->value );
184
185
}
186
+
187
+ #[Test]
188
+ public function inside_annotation () {
189
+ $ f = $ this ->run ('use lang\Reflection; class %T {
190
+
191
+ #[Attr(strrev(...))]
192
+ public function run() {
193
+ return Reflection::of($this)->method("run")->annotation(Attr::class)->argument(0);
194
+ }
195
+ } ' );
196
+ Assert::equals ('cba ' , $ f ('abc ' ));
197
+ }
185
198
}
You can’t perform that action at this time.
0 commit comments