<?xml version="1.0"?>
<documentation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
    title="New Use Const/Function Statements"
    >
    <standard>
    <![CDATA[
    Importing constants and functions via a `use` statement is supported since PHP 5.6.

    The `use` operator has been extended to support importing functions and
    constants in addition to classes. This is achieved via the `use function`
    and `use const` constructs, respectively.
    ]]>
    </standard>
    <code_comparison>
        <code title="Cross-version compatible: using constants and functions without importing them into the namespace.">
        <![CDATA[
namespace Airworthy\Vendor\My\Project;






echo <em>\Airworthy\Vendor\Other\Project\ConstA</em>, <em>PHP_EOL</em>;
echo <em>trim</em>($string);
echo <em>\Airworthy\Vendor\Other\Project\fn_a()</em>;
        ]]>
        </code>
        <code title="PHP &gt;= 5.6: importing constants and functions into a namespace using `use function` and `use const` declarations.">
        <![CDATA[
namespace Airworthy\Vendor\My\Project;

<em>use const PHP_EOL;</em>
<em>use const Airworthy\Vendor\Other\Project\ConstA;</em>
<em>use function trim;</em>
<em>use function Airworthy\Vendor\Other\Project\fn_a;</em>

echo <em>ConstA</em>, <em>PHP_EOL</em>;
echo <em>trim</em>($string);
echo <em>fn_a()</em>;
        ]]>
        </code>
    </code_comparison>
</documentation>
