Skip to content

partial variable names are not handled correctly #5

@pentium10

Description

@pentium10

the ConcatExpressionCompiler works with this syntax:

  • "Hello " ~ name ~ "!"
  • myVar ~ "abc"

but doesn't support syntax where you have a variable that's has the same name but with some other suffix:

  • myVar ~ myVar2
  • myVar ~ "" ~ myVar2
//concat
echo $e = 'myVar ~ myVar2';
echo "<br/>\r\n";
$evaluator = eval($compiler->compileExpression(new Expression($e)));
$context = array(
    'myVar' => 'abc',
    'myVar2' => '123'
);

When we change myVar2 to something else it starts working.
Further on our investigation, it might the number that causes the problem. In this case a special exception should be thrown to notify the developer that the variable names are not language standards.

@Kitano @adrienbrault How this should work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions