Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't split T_INLINE_HTML at partial PHP tag
If <?php occurs without required trailing whitespace, we should keep it as part of a single T_INLINE_HTML region.
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 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
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-- | ||
Inline HTML should not be split at partial PHP tags | ||
--INI-- | ||
short_open_tag=0 | ||
--FILE-- | ||
<?php | ||
|
||
var_dump(token_get_all(<<<'PHP' | ||
Foo<?phpBar | ||
PHP)); | ||
|
||
?> | ||
--EXPECTF-- | ||
array(1) { | ||
[0]=> | ||
array(3) { | ||
[0]=> | ||
int(%d) | ||
[1]=> | ||
string(11) "Foo<?phpBar" | ||
[2]=> | ||
int(1) | ||
} | ||
} |