Skip to content

Commit 76e9d24

Browse files
committed
fixup! Support first-class callables in const-expressions
1 parent e8b51f4 commit 76e9d24

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
AST printing for FCC in attributes at runtime
3+
--FILE--
4+
<?php
5+
6+
namespace Test;
7+
8+
class Clazz {
9+
#[Attr(strrev(...), \strrev(...), Clazz::foo(...), self::foo(...))]
10+
function foo() { }
11+
}
12+
13+
$r = new \ReflectionMethod(Clazz::class, 'foo');
14+
foreach ($r->getAttributes() as $attribute) {
15+
echo $attribute;
16+
}
17+
18+
?>
19+
--EXPECT--
20+
Attribute [ Test\Attr ] {
21+
- Arguments [4] {
22+
Argument #0 [ Test\strrev(...) ]
23+
Argument #1 [ \strrev(...) ]
24+
Argument #2 [ \Test\Clazz::foo(...) ]
25+
Argument #3 [ self::foo(...) ]
26+
}
27+
}

0 commit comments

Comments
 (0)