Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7468047
DuplicateArrayKeyStandard.xml
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1001 B
Referenced Files
None
Subscribers
None
DuplicateArrayKeyStandard.xml
View Options
<?xml version="1.0"?>
<documentation
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
title=
"Duplicate Array Key"
>
<standard>
<![CDATA[
When a second array item with the same key is declared, it will overwrite the first.
This sniff detects when this is happening in array declarations.
]]>
</standard>
<code_comparison>
<code
title=
"Valid: Arrays with unique keys."
>
<![CDATA[
$
args = array(
<em>'foo'</em> => 22,
<em>'bar'</em> => 25,
<em>'baz'</em> => 28,
);
$
args = array(
22,
25,
2 => 28,
);
]]>
</code>
<code
title=
"Invalid: Array with duplicate keys."
>
<![CDATA[
$
args = array(
<em>'foo'</em> => 22,
<em>'bar'</em> => 25,
<em>'bar'</em> => 28,
);
$
args = array(
22,
25,
1 => 28,
);
]]>
</code>
</code_comparison>
</documentation>
File Metadata
Details
Attached
Mime Type
text/xml
Expires
Mon, Nov 23, 06:23 (3 d, 12 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
48/ac/54bab5e77d769230a626ac46e32c
Default Alt Text
DuplicateArrayKeyStandard.xml (1001 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment