Skip to content

Null coalescing operator on Vector make search failed #206

@josephLaurent

Description

@josephLaurent

Hello,

I have a strange issue with Vector after accessing element with the Null coalescing operator.

$vector = new Vector([5, 6, 7]);

var_dump($vector->contains(5)); // Print true
var_dump($vector->contains(6)); // Print true

$vector[0] ?? null;

var_dump($vector->contains(5)); // Print false !!!
var_dump($vector->contains(6)); // Print true

Is this expected ? Can it be fixed ?

Don't hesitate if you need more info and thank you in advance for your help

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