Re: ZEND_ENGINE_4 define?
| From: | Nikita Popov | Date: | Mon, 10 Aug 2020 07:37:25 +0000 |
| Subject: | Re: ZEND_ENGINE_4 define? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111414@lists.php.net to get a copy of this message | ||
On Mon, Aug 10, 2020 at 7:57 AM Philip Hofstetter <
phofstetter@sensational.ch> wrote:
> Hello,
>
> I'm currently looking into porting some extensions (both internal and
> public) to PHP 8 while still keeping support for PHP 7 (for the public
> ones) and PHP 5.6 (don't ask :-().
>
> 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 (which
> feels warranted given the zval* to zend_object* changes for object
> handlers), but ZEND_ENGINE_3 is still defined whereas there's no
> ZEND_ENGINE_4.
>
> Is this something that might change or should I just use
> PHP_VERSION_ID comparisons to deal with the zval* to zend_object*
> changes?
>
> Philip
>
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.
Regards,
Nikita