File: ValidDefaultValueStandard.xml

package info (click to toggle)
php-codesniffer 1.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,092 kB
  • sloc: php: 30,445; xml: 3,768; makefile: 15; pascal: 8; sh: 6
file content (25 lines) | stat: -rw-r--r-- 635 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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>