New magic constant in PHP 5.3 13

In PHP 5.3 there will be another magic constant __DIR__. Until 5.3 a typical pattern to include files was to do something like this:

[geshi lang=php]The extra dirname()-call will be gratuitous:

[geshi lang=php]__DIR__ always references the directory which contains the current file. In case of /var/www/host/app/foo.php the __DIR__ will reference /var/www/host/app.
To allow this, the internal function php_dirname() has been moved in the Zend Engine and is now called zend_dirname(). Nevertheless an alias still exists.

Filed on 22-02-2008, 08:08 under , & 13 comments & no trackbacks


Trackback specific URI for this entry

No Trackbacks


No comments

Add a Comment & let me know what you think