pass multiple defines or const as a parameter to a class method
<p>Can I do something like this?</p>

<pre><code>class Test
{
    const FLAG1 = 'flag1.';
    const FLAG2 = 'flag2.';

    public function __construct() {}

    public function myMethod($flags)
    {
        echo $flags
    }
}
</code></pre>

<p>then use it like</p>

<pre><code>$test = new Test();
$test-&gt;myMethod(Test::FLAG1|Test::FLAG2);
</code></pre>

<p>I tried to use this example but I get <code>2</code> as my <code>echo</code>.
I was just curious to see how I can use either <code>CONST</code> or <code>DEFINE</code> as parameters to a method.</p>

<p>I ask because I found this script that uses this technique and I found it curious</p>

<p><a href="http://www.pgregg.com/projects/php/preg_find/preg_find.php.txt" rel="nofollow">http://www.pgregg.com/projects/php/preg_find/preg_find.php.txt</a></p>
