Skip to content

Support underscores in string interpolation numeric offsets #6

@TysonAndre

Description

@TysonAndre

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions