-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve the original AST for closures in const-expressions
This is necessary when stringifying a `ReflectionAttribute` that has a closure as a parameter.
- Loading branch information
Showing
9 changed files
with
100 additions
and
22 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
Zend/tests/closure_const_expr/attributes_ast_printing_runtime.phpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--TEST-- | ||
AST printing for closures in attributes at runtime | ||
--FILE-- | ||
<?php | ||
|
||
#[Attr(static function ($foo) { | ||
echo $foo; | ||
})] | ||
function foo() { } | ||
|
||
$r = new ReflectionFunction('foo'); | ||
foreach ($r->getAttributes() as $attribute) { | ||
echo $attribute; | ||
} | ||
|
||
?> | ||
--EXPECT-- | ||
Attribute [ Attr ] { | ||
- Arguments [1] { | ||
Argument #0 [ static function ($foo) { | ||
echo $foo; | ||
} ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters