Skip to content

PECL Ds\Map numeric string key warnings are incorrect #5551

@tminich

Description

@tminich

From manual page: https://php.net/ds-map.get and https://php.net/ds-map.set


Both pages read

Caution
Be careful when using array syntax. Scalar keys will be coerced to integers by the engine.
For example, $map["1"] will attempt to access int(1), while $map->get("1") will correctly look up the string key.

See [Arrays](https://www.php.net/manual/en/language.types.array.php).

This is incorrect (probably outdated), Ds\Map preserves and expects numeric string keys as string no matter how you access them.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions