PHP Classes

File: vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Download Installed Plugin   vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml   Download  
File: vendor/phpcsstandards/phpcsextra/Universal/Docs/Arrays/MixedArrayKeyTypesStandard.xml
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Download Installed Plugin
Download a WordPress plugin as a ZIP archive
Author: By
Last change:
Date: Yesterday
Size: 986 bytes
 

Contents

Class file image Download
<?xml version="1.0"?> <documentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd" title="Mixed Array Key Types" > <standard> <![CDATA[ In an array where the items have keys, all items should either have a numeric key assigned or a string key. A mix of numeric and string keys is not allowed. ]]> </standard> <code_comparison> <code title="Valid: Arrays with either numeric keys or string keys."> <![CDATA[ $args = array( <em>'foo'</em> => 22, <em>'bar'</em> => 25, ); $args = array( <em>0</em> => 22, <em>1</em> => 25, ); ]]> </code> <code title="Invalid: Arrays with a mix of numeric and string keys."> <![CDATA[ $args = array( 'foo' => 22, 25, ); $args = array( 'foo' => 22, 12 => 25, ); ]]> </code> </code_comparison> </documentation>