mirror of
https://github.com/php/php-src.git
synced 2024-12-14 04:16:30 +08:00
2cc3aeb4b9
We allow negative numeric offsets for the simple syntax inside double-quoted and heredoc strings.
23 lines
295 B
PHP
23 lines
295 B
PHP
--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===
|