On Mon, Aug 10, 2020 at 2:37 AM Nikita Popov <nikita....@gmail.com> wrote:

> On Mon, Aug 10, 2020 at 7:57 AM Philip Hofstetter <
> phofstet...@sensational.ch> wrote:
> > In many cases, I've been using the ZEND_ENGINE_3 define to handle the
> > PHP 5/7 difference.
> >
> > Now, the Zend Engine version seems to have been increased to 4
>
> I would recommend using PHP_VERSION_ID.
>
> I have no idea why we have the ZEND_ENGINE_3 constant, but it seems like a
> pretty bad idea. Now that we are at ZE 4, should we drop that constant --
> and break all the code using it? Chances are that code guarded by
> ZEND_ENGINE_3 is also needed on all versions of ZE going forward, not just
> ZE 3 in particular. I think we should just leave teh ZEND_ENGINE_3 define
> around, but make sure not to introduce a new one of that kind.
>
>
I agree that ZEND_ENGINE_n was always a weird constant, and IIRC we had the
7.x series export both ZEND_ENGINE_2 and ZEND_ENGINE_3.  Not sure. (and the
fact I'm not sure is also telling).

This is probably much more expressive:  #if PHP_VERSION_ID >= 80000
If one *really* wants "Zend" versioning, you similarly could do: #if
ZEND_EXTENSION_API_NO >= 400000000

How many version indicators do we need?

Reply via email to