<p>This is how I wanted to do it which would work in PHP 5.3.0+</p>

<pre><code>&lt;?php
    class MyClass
    {
        const CONSTANT = 'Const var';        
    }

    $classname = 'MyClass';
    echo $classname::CONSTANT; // As of PHP 5.3.0
?&gt;
</code></pre>

<p>But I'm restricted to using PHP 5.2.6. Can anyone think of a simple way to simulate this behavior without instantiating the class?</p>

If you absolutly need to access a constant like that, you can do this:
```
```
<?php
class MyClass
{
        const CONSTANT = 'Const var';
}

$classname = 'MyClass';
echo eval( 'return '.$classname.'::CONSTANT;' );
?>
```
```
But, if i were you, I'd try not to use eval.