php-vim-syntax icon indicating copy to clipboard operation
php-vim-syntax copied to clipboard

Support underscores in string interpolation numeric offsets

Open TysonAndre opened this issue 5 years ago • 0 comments

The string representation is used as the array key, not the number it evaluates to. (support 0b1_0, -0x1_f, -0_1_7, etc)

<?php
$a1 = array('-1_2_3' => 'value for string');
$a2 = array();
$a2["$a1[-1_2_3]"] = "second";
var_export($a2);

Highlight invalid octal literals such as 09 as syntax errors in phpInterpSimpleBrackets in offsets of string encapsulation (should already be fixed in regular literals)

Discovered while working on #4

TysonAndre avatar Dec 15 '20 00:12 TysonAndre