Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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