Hi Marcus-

Marcus Börger wrote:

Constants are bound to the class rather then to the objects. Hence they
behave pretty much like static properties or default values of declared
properties and like the latter they are read only.


understood.

The only question here is whether we want to be able to access static
and/or const class members through something dynamically like $this at
runtime. Everything else is perfectly correct in place.

And of course constants are public. So perhaps you might want to be able
to apply visibility to constants, too? If so i must dissappoint you with
the fact that it is currently impossible to do that and the amount of work
to enable this seems so high that it is unlike to happen.



So, in order to access class constants from outside the class, the
class itself must be static? Obviously (I thought for backwards
compatability only) all classes are static in PHP5, but looking toward
the future, will we continue to have all classes always statically
accessible?

Dan Cox

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to