PHP Classes

File: zray/vendor/PHP_CodeSniffer-2.2.0/CodeSniffer/Standards/CodeIgniter/Docs/Strings/DoubleQuoteUsageStandard.xml

Recommend this page to a friend!
  Classes of Simo  >  CodeIgniter Plugin for Z-Ray  >  zray/vendor/PHP_CodeSniffer-2.2.0/CodeSniffer/Standards/CodeIgniter/Docs/Strings/DoubleQuoteUsageStandard.xml  >  Download  
File: zray/vendor/PHP_CodeSniffer-2.2.0/CodeSniffer/Standards/CodeIgniter/Docs/Strings/DoubleQuoteUsageStandard.xml
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: CodeIgniter Plugin for Z-Ray
Show CodeIgniter application information in Z-Ray
Author: By
Last change:
Date: 5 months ago
Size: 1,266 bytes
 

Contents

Class file image Download
<documentation title="Double-quoted strings"> <standard> <![CDATA[ Always use single quoted strings unless you need variables parsed, and in cases where you do need variables parsed, use braces to prevent greedy token parsing. You may also use double-quoted strings if the string contains single quotes, so you do not have to use escape characters. ]]> </standard> <code_comparison> <code title="Examples of invalid double-quoted strings"> <![CDATA[ "My String" // no variable parsing, so no use for double quotes "My string $foo" // needs braces 'SELECT foo FROM bar WHERE baz = \'bag\'' // ugly '\r\n' // it isn't wrong, but it won't be interpreted as a new line feed ]]> </code> <code title="Examples of valid double-quoted strings"> <![CDATA[ 'My String' "My string {$foo}" // variables in strings may be enclosed with braces in 2 ways "My string ${foo}" "My string {$foo['bar']}" // variables in strings may be an array entry "My string {$foo->bar}" // variables in strings may be an object attribute "SELECT foo FROM bar WHERE baz = 'bag'" "\n" // not specified in Code Igniter coding standard, but it should be allowed ]]> </code> </code_comparison> </documentation>