Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow comments between intersection types and by-ref params
- Loading branch information
Showing
4 changed files
with
50 additions
and
4 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
13 changes: 13 additions & 0 deletions
13
Zend/tests/type_declarations/intersection_types/parsing_attribute.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,13 @@ | ||
--TEST-- | ||
Intersection type parsing and by-ref parsing interaction with attributes | ||
--FILE-- | ||
<?php | ||
|
||
class Test { | ||
public X& #[Comment] | ||
Z $p; | ||
} | ||
|
||
?> | ||
--EXPECTF-- | ||
Parse error: syntax error, unexpected token "#[" in %s on line %d |
26 changes: 26 additions & 0 deletions
26
Zend/tests/type_declarations/intersection_types/parsing_comment.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,26 @@ | ||
--TEST-- | ||
Intersection type and by-ref parameter parsing with comments | ||
--FILE-- | ||
<?php | ||
|
||
class Test { | ||
function f1(A & /* | ||
Comment // ** / / * * **/ B $p) {} | ||
function f2(A & // Comment | ||
B $p) {} | ||
function f3(A & # Comment | ||
B $p) {} | ||
function f4(A & # | ||
B $p) {} | ||
function f6(A & /* | ||
Comment // ** / / * * **/ $p) {} | ||
function f7(A & // Comment | ||
$p) {} | ||
function f8(A & # Comment | ||
$p) {} | ||
function f9(A & # | ||
$p) {} | ||
} | ||
|
||
?> | ||
--EXPECT-- |
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
f291d37
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit made a regression heap-buffer-overflow in master (oss-fuzz Issue 55793)
f291d37
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment of this
unexpected end of file
errorLANG_SCNG(yy_leng)
contains length of the previous token.