Skip to content

Commit c60c1e2

Browse files
committed
Verify first-class callables work in annotations
See https://wiki.php.net/rfc/closures_in_const_expr#future_scope
1 parent 268c79e commit c60c1e2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/test/php/lang/ast/unittest/emit/AnnotationSupport.class.php

+6
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ public function closure_value() {
7474
Assert::equals('test', $verify[0]('test'));
7575
}
7676

77+
#[Test]
78+
public function first_class_callable_value() {
79+
$verify= $this->annotations($this->declare('#[Verify(strtoupper(...))]'))['Verify'];
80+
Assert::equals('TEST', $verify[0]('test'));
81+
}
82+
7783
#[Test]
7884
public function arrow_function_value() {
7985
$verify= $this->annotations($this->declare('#[Verify(fn($arg) => $arg)]'))['Verify'];

0 commit comments

Comments
 (0)