PECL Ds\Map numeric string key warnings are incorrect

Open Beginner friendly
#22 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
php
Domain
documentation

Research direction

Start with the PECL Ds\Map documentation for the get and set manual pages linked in the issue, then locate the caution text about numeric string keys. Update the wording to reflect that Ds\Map preserves numeric string keys for both access forms, and verify both pages no longer make the incorrect claim.

Written by the indexing model from the issue text.

Description

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
Dominant language
XML
Stars
2
Forks
6
Avg merge
1d 14h
Merged PRs (30d)
5

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from php/doc-extensions

All issues in php/doc-extensions

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.