Comma in public variable
<p>I remember reading this code somewhere:</p>

<pre><code>&lt;?php

class test {
    public $foo = 6, $bar;
}

$a = new test();
echo $a-&gt;foo; //6
echo $a-&gt;bar; //no output
</code></pre>

<p>What does the comma do in <code>public $foo = 6, $bar;</code>? Why does my IDE give me error when I remove <code>public</code>? I do find out that <code>$bar</code> is declared by doing so, but I don't think that's the sole reason why you code it this way though. </p>
