-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix assert with attribute + first-class callable in assert
This is going to result in a compile-time error, but AST printing is invoked first and should handle it gracefully. Handle it by falling back to more generic printing code. Fixes oss-fuzz #36264.
- Loading branch information
Showing
2 changed files
with
13 additions
and
11 deletions.
There are no files selected for viewing
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,11 @@ | ||
--TEST-- | ||
Foo(...) in attribute in assert | ||
--FILE-- | ||
<?php | ||
assert(function() { | ||
#[Foo(...)] | ||
class Test {} | ||
}); | ||
?> | ||
--EXPECTF-- | ||
Fatal error: Cannot create Closure as attribute argument in %s on line %d |
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