We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ae3ccb commit 3bf4ccbCopy full SHA for 3bf4ccb
src/test/php/lang/ast/unittest/emit/CallableSyntaxTest.class.php
@@ -6,6 +6,7 @@
6
/**
7
* Tests for first-class callable syntax
8
*
9
+ * @see https://wiki.php.net/rfc/fcc_in_const_expr
10
* @see https://wiki.php.net/rfc/first_class_callable_syntax#proposal
11
*/
12
class CallableSyntaxTest extends EmittingTest {
@@ -182,4 +183,16 @@ public function __construct($value) { $this->value= $value; }
182
183
}');
184
Assert::equals($this, $f($this)->value);
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
198
0 commit comments