On Feb 6, 2016 3:02 AM, "Sara Golemon" wrote:
On Fri, Feb 5, 2016 at 8:20 AM, Pierre Joye wrote:
I do however like the idea of feature detection - I wonder if perhaps
could do something where it's done at compile time and therefore
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 :)

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 17 of 17 | next ›
Discussion Overview
groupphp-internals @
postedFeb 3, '16 at 9:03a
activeFeb 6, '16 at 6:11a



site design / logo © 2019 Grokbase