forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement #72918: negative offset inside a quoted string leads to par…
…se error We allow negative numeric offsets for the simple syntax inside double-quoted and heredoc strings.
- Loading branch information
Showing
6 changed files
with
3,979 additions
and
4,119 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,22 @@ | ||
--TEST-- | ||
Bug #72918 (negative offset inside a quoted string leads to parse error) | ||
--FILE-- | ||
<?php | ||
$array = [-3 => 'foo']; | ||
$string = 'abcde'; | ||
|
||
echo "$array[-3]\n"; | ||
echo "$string[-3]\n"; | ||
echo <<<EOT | ||
$array[-3] | ||
$string[-3] | ||
EOT; | ||
?> | ||
===DONE=== | ||
--EXPECT-- | ||
foo | ||
c | ||
foo | ||
c | ||
===DONE=== |
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
Oops, something went wrong.