PHP: classes using each other
<p>I have parent class Color and children, ColorRGBA and ColorHSLA. In class Color I want to use a static functions from these children, but I got error "Class 'Color' not found." Here is the same problem <a href="http://forums.codeguru.com/showthread.php?t=469995" rel="nofollow">http://forums.codeguru.com/showthread.php?t=469995</a> but <code>class Color;</code> doesn't seem to work in PHP.</p>

<p>Color.php:</p>

<pre><code>include_once 'ColorRGBA.php';
include_once 'ColorHSLA.php';

class Color{
    public static function isValid(&amp;$tokens, $i) {
        return ColorRGBA::isValid($tokens, $i) || ColorHSLA::isValid($tokens, $i);
    }
}
</code></pre>

<p>ColorHLSA.php and similarly ColorRGBA.php</p>

<pre><code>include_once 'Color.php';

class ColorRGBA extends Color {
    public static function isValid(&amp;$t, &amp;$i) {
        ...
    }
}
</code></pre>

<p>How should I rebuild my class hierarchy or include directives? Or is there any other option how to make my code work?</p>
