PHP Classes

File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Download Installed Plugin   vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.xml   Download  
File: vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/ControlStructures/ForEachLoopDeclarationStandard.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: 1,041 bytes
 

Contents

Class file image Download
<documentation title="Foreach Loop Declarations"> <standard> <![CDATA[ There should be a space between each element of a foreach loop and the as keyword should be lowercase. ]]> </standard> <code_comparison> <code title="Valid: Correct spacing used."> <![CDATA[ foreach (<em></em>$foo<em> </em>as<em> </em>$bar<em> </em>=><em> </em>$baz<em></em>) { echo $baz; } ]]> </code> <code title="Invalid: Invalid spacing used."> <![CDATA[ foreach (<em> </em>$foo<em> </em>as<em> </em>$bar<em></em>=><em></em>$baz<em> </em>) { echo $baz; } ]]> </code> </code_comparison> <code_comparison> <code title="Valid: Lowercase as keyword."> <![CDATA[ foreach ($foo <em>as</em> $bar => $baz) { echo $baz; } ]]> </code> <code title="Invalid: Uppercase as keyword."> <![CDATA[ foreach ($foo <em>AS</em> $bar => $baz) { echo $baz; } ]]> </code> </code_comparison> </documentation>