Dear internals! I have encountered an inconsistence, or rather a bug, in PHP's syntax. The thing is, in PHP you can access constants defined on a class using reference to an instance of this class, stored in variable. So we have a code:
<?php class B { const C = 4; } $b = new B; var_dump($b::C === B::C); // bool(true) ?> Which will nicely pass. But things will go wrong having a code trying to access the same constant on an object of B stored in member variable of class A -- let's see below: <?php class A { /** @var B */ public $b; } $a = new A; $a->b = new B; var_dump($a->b::C === B::C); // Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in... ?> Let me conclude that if there's access to class' constant using a reference to an instance of the class, it should be possible with any type of value-holder (so-called variable). -- Cheers, Kubis -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php