Skip to content

Spurious failure on nested conditionals without parentheses #360

@arichard4

Description

@arichard4

tolerant-php-parser reports errors on the following:

<?php $val = true ? true ? true : true : true;

The error reported is "':' expected." Per php -l, the code itself is valid for php8. If I explicitly add parentheses to clarify the order of operations, no errors are reported:

<?php $val = true ? (true ? true : true) : true;

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