Re: Re: [RFC] Add PHP_ENGINE Constant
| From: | Pierre Joye | Date: | Sat, 06 Feb 2016 06:11:25 +0000 |
| Subject: | Re: Re: [RFC] Add PHP_ENGINE Constant | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91097@lists.php.net to get a copy of this message | ||
On Feb 6, 2016 3:02 AM, "Sara Golemon" <pollita@php.net> wrote:
>
> On Fri, Feb 5, 2016 at 8:20 AM, Pierre Joye <pierre.php@gmail.com> wrote:
> >> I do however like the idea of feature detection - I wonder if perhaps
we
> >> could do something where it's done at compile time and therefore
minimally
> >> impacts runtime?
> >
> > This could be what you actually need. A #ifdef equivalent for PHP. I
> > remember a discussion about adding these features to the core to allow
> > to enable/disable portions of a script at the parsing/compilation
> > level. Doing so allows mixing codes being valid for various
> > implementations inside a same file. It is especially important for
> > features using syntax not compatible with a php.net's PHP
> > specification (for instance).
> >
> This usually results in some half-hearted attempts followed by "just
> use gcc's preprocessor for that". :)
Yeah, preprocessor (gcc or other) sounds a bit awkward for php while I can
understand why one or the other would like to have it. But still, having
php code cluttered with #ifdef like codes is not very appealing :)