1<documentation title="SAPI Usage">
2    <standard>
3    <![CDATA[
4    The PHP_SAPI constant should be used instead of php_sapi_name().
5    ]]>
6    </standard>
7    <code_comparison>
8        <code title="Valid: PHP_SAPI is used.">
9        <![CDATA[
10if (<em>PHP_SAPI</em> === 'cli') {
11    echo "Hello, CLI user.";
12}
13        ]]>
14        </code>
15        <code title="Invalid: php_sapi_name() is used.">
16        <![CDATA[
17if (<em>php_sapi_name()</em> === 'cli') {
18    echo "Hello, CLI user.";
19}
20        ]]>
21        </code>
22    </code_comparison>
23</documentation>
24