|
Posted by Chung Leong on 11/19/37 11:47
Alan Little wrote:
> I'm just surprised that whoever thought of the __FILE__ constant didn't
> think to make this one as well, both for reasons of reliability and
> security.
It's not that surprising if you consider the architecture. PHP is
consisted of the PHP framework and the Zend engine. __FILE__, along
with __CLASS__, and __FUNCTION__, live in application-agnostic Zend
land. The information they hold is readily already to the language
parser. PHP_SELF on the other hand has to live in PHP-SAPI land, since
that's information from the web server. It's possible to implement what
you described, but then we would end up with cross-talk between
components that are supposed to be independent.
Again, __FILE__ is not a constant. It's a language construct. Its value
changes--unlike a constant.
Navigation:
[Reply to this message]
|