Skip to content

Map::get(): argument fallback value #77

@aubryfr

Description

@aubryfr

Am I right that that the fallback value for $default in Map::get() can never be used?
https://github.com/php-ds/polyfill/blob/master/src/Map.php#L320

If the method is called without its second argument (to get the fallback value), the call will fail here (as confirmed by the testGetKeyNotFound test).

In that case, I'd say it should be removed from the signature.

(Or maybe there's a PHP trick that I'm not thinking about?)

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