Re: [patch] expose PHP version details as constants
| From: | Lars Strojny | Date: | Mon, 11 Feb 2008 10:41:18 +0000 |
| Subject: | Re: [patch] expose PHP version details as constants | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-35361@lists.php.net to get a copy of this message | ||
Hi Stanislav,
Am Sonntag, den 10.02.2008, 21:11 -0800 schrieb Stanislav Malyshev:
[...]
> Actually, just as __FILE__, __LINE__, __CLASS__ etc. dirname(__FILE__)
> can be a parser constant. And if somebody produces a good name and a
> patch for it, I see no reason to reject it. Does anybody?
For the name I would propose __DIR__, same as to __FILE__, __CLASS__,
__NAMESPACE__ etc. pp.
I tried to do it yesterday, but I need some advice on how to do it. So
far I need to add another token and an ST_IN_SCRIPTING entry. Basically
the quick hack would be to use zend_get_compiled_filename() in it. I
stuck how to extract the dirname. Should I use php_dirname() (which is
platform sensitive but this is considered inappropriate from what I
heard), should php_dirname() be moved? Or should I introduce another
hash table entry for the current dirname?
cu, Lars
Attachment: [application/pgp-signature] Dies ist ein digital signierter Nachrichtenteil signature.asc
Attachment: [application/pgp-signature] Dies ist ein digital signierter Nachrichtenteil signature.asc