Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: correct array indicies when using ternary or coalesce ops #2695

Merged
merged 1 commit into from
Nov 14, 2019

Commits on Nov 14, 2019

  1. Hotfix: correct array indicies when using ternary or coalesce ops

    Fixes squizlabs#2694
    
    I have find out that the issue is also when using coalesce operator.
    Example, which is valid code, but has no sens would be:
    
    ```php
    $array = [
        'foo' => 'foo',
        'bar' => $baz ? ['abc'] : ['def'],
        'hey' => $baz ?? ['one'] ?? ['two'],
    ];
    ```
    
    Without fix we have 5 elements in `$indices` but we should have 3.
    
    Added tests to cover changes.
    michalbundyra committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    e6b37df View commit details
    Browse the repository at this point in the history