<?php class Foo { const BAR = 'bar'; public static function getConstantValue() { return self::BAR; } public function getConstant() { return self::BAR; } } $foo = 'Foo'; echo $foo::BAR, ''; echo Foo::BAR, ''; $obj = new Foo(); echo $obj->getConsta