Initial Commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<documentation title="Function Calls">
|
||||
<standard>
|
||||
<![CDATA[
|
||||
Functions should be called with no spaces between the function name, the opening parenthesis, and the first parameter; and no space between the last parameter, the closing parenthesis, and the semicolon.
|
||||
]]>
|
||||
</standard>
|
||||
<code_comparison>
|
||||
<code title="Valid: spaces between parameters">
|
||||
<![CDATA[
|
||||
$var = foo($bar, $baz, $quux);
|
||||
]]>
|
||||
</code>
|
||||
<code title="Invalid: additional spaces used">
|
||||
<![CDATA[
|
||||
$var = foo<em> </em>(<em> </em>$bar, $baz, $quux<em> </em>)<em> </em>;
|
||||
]]>
|
||||
</code>
|
||||
</code_comparison>
|
||||
</documentation>
|
||||
@@ -0,0 +1,25 @@
|
||||
<documentation title="Default Values in Function Declarations">
|
||||
<standard>
|
||||
<![CDATA[
|
||||
Arguments with default values go at the end of the argument list.
|
||||
]]>
|
||||
</standard>
|
||||
<code_comparison>
|
||||
<code title="Valid: argument with default value at end of declaration">
|
||||
<![CDATA[
|
||||
function connect($dsn, <em>$persistent = false</em>)
|
||||
{
|
||||
...
|
||||
}
|
||||
]]>
|
||||
</code>
|
||||
<code title="Invalid: argument with default value at start of declaration">
|
||||
<![CDATA[
|
||||
function connect(<em>$persistent = false</em>, $dsn)
|
||||
{
|
||||
...
|
||||
}
|
||||
]]>
|
||||
</code>
|
||||
</code_comparison>
|
||||
</documentation>
|
||||
Reference in New Issue
Block a user