/usr/portage

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

Trackbacks

Trackback specific URI for this entry

No Trackbacks

Comments

  1. Paul M replys:
    published on February 22nd 2008, 10:27:43 am *

    Reply

  2. Toby opines:
    published on February 22nd 2008, 10:42:02 am *

    Reply

  3. bapro means:
    published on February 22nd 2008, 12:57:36 pm *

    Reply

  4. Andre Moelle reckons:
    published on February 22nd 2008, 02:42:58 pm *

    Reply

  5. Stuart Herbert supposes:
    published on February 23rd 2008, 12:30:44 pm *

    Reply

  6. Lars Strojny returns:
    published on February 23rd 2008, 01:49:09 pm *

    Reply

  7. Stuart Herbert supposes:
    published on February 23rd 2008, 04:04:09 pm *

    Reply

  8. Lars Strojny returns:
    published on February 23rd 2008, 09:11:35 pm *

    Reply

  9. NikoB reckons:
    published on September 26th 2008, 09:48:53 pm *

    Reply

  10. BlazS states:
    published on February 25th 2008, 08:57:53 am *

    Reply

  11. Lars Strojny returns:
    published on February 25th 2008, 09:24:18 am *

    Reply

  12. BlazS states:
    published on February 25th 2008, 09:33:30 am *

    Reply

  13. Omardoliamy returns:
    published on January 20th 2009, 03:52:16 pm *

    Reply

Add a Comment & let me know what you think