We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a75d04c commit a96398eCopy full SHA for a96398e
Zend/tests/closure_const_expr/attributes_ast_printing.phpt
@@ -0,0 +1,41 @@
1
+--TEST--
2
+AST printing for closures in attributes
3
+--FILE--
4
+<?php
5
+
6
+// Do not use `false &&` to fully evaluate the function / class definition.
7
8
+try {
9
+ \assert(
10
+ !
11
+ #[Attr(static function ($foo) {
12
+ echo $foo;
13
+ })]
14
+ function () { }
15
+ );
16
+} catch (Error $e) {
17
+ echo $e->getMessage(), "\n";
18
+}
19
20
21
22
23
+ new #[Attr(static function ($foo) {
24
25
26
+ class {}
27
28
29
30
31
32
+?>
33
+--EXPECT--
34
+assert(!#[Attr(static function ($foo) {
35
36
+})] function () {
37
+})
38
+assert(!new #[Attr(static function ($foo) {
39
40
+})] class {
41
0 commit comments