Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions reference/ds/ds/map/get.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,14 @@
</simpara>
</note>

<caution>
<simpara>
Be careful when using array syntax. Scalar keys will be coerced to
integers by the engine. For example, <code>$map["1"]</code> will attempt
to access <code>int(1)</code>, while <code>$map-&gt;get("1")</code> will
correctly look up the string key.
</simpara>
<note>
<simpara>
See <link xlink:href="&url.php.manual.language.types.array;">Arrays</link>.
Unlike with <link xlink:href="&url.php.manual.language.types.array;">arrays</link>,
numeric string keys are not cast to integers, even when using array
syntax. For example, <code>$map["1"]</code> and <code>$map[1]</code>
refer to two different keys.
</simpara>
</caution>
</note>

</refsect1>

Expand Down
15 changes: 6 additions & 9 deletions reference/ds/ds/map/put.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,14 @@
</simpara>
</note>

<caution>
<simpara>
Be careful when using array syntax. Scalar keys will be coerced to
integers by the engine. For example, <code>$map["1"]</code> will attempt
to access <code>int(1)</code>, while <code>$map-&gt;get("1")</code> will
correctly look up the string key.
</simpara>
<note>
<simpara>
See <link xlink:href="&url.php.manual.language.types.array;">Arrays</link>.
Unlike with <link xlink:href="&url.php.manual.language.types.array;">arrays</link>,
numeric string keys are not cast to integers, even when using array
syntax. For example, <code>$map["1"]</code> and <code>$map[1]</code>
refer to two different keys.
</simpara>
</caution>
</note>

</refsect1>

Expand Down
17 changes: 7 additions & 10 deletions reference/ds/ds/map/remove.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,18 @@

<note>
<simpara>
You can also use array syntax to access values by key, eg. <code>$map["key"]</code>.
You can also use array syntax to remove values by key, eg. <code>unset($map["key"])</code>.
</simpara>
</note>

<caution>
<simpara>
Be careful when using array syntax. Scalar keys will be coerced to
integers by the engine. For example, <code>$map["1"]</code> will attempt
to access <code>int(1)</code>, while <code>$map-&gt;get("1")</code> will
correctly look up the string key.
</simpara>
<note>
<simpara>
See <link xlink:href="&url.php.manual.language.types.array;">Arrays</link>.
Unlike with <link xlink:href="&url.php.manual.language.types.array;">arrays</link>,
numeric string keys are not cast to integers, even when using array
syntax. For example, <code>$map["1"]</code> and <code>$map[1]</code>
refer to two different keys.
</simpara>
</caution>
</note>

</refsect1>

Expand Down