I realize that ZE3 is not ZE2, but I always saw the ZEND_ENGINE_2
define as more of a "At least ZE2" so that code of the form:
#ifdef ZEND_ENGINE_2
newAPI();
#else /* ZE1 */
oldAPI();
#endif
Would continue making sense (modulo newNewAPI() in ZE3, of course).
Was the ZEND_ENGINE_2 define removed on purpose? Or as an accidental
side-effect of a mass update to "We're ZE3 now!"
-Sara
I realize that ZE3 is not ZE2, but I always saw the ZEND_ENGINE_2
define as more of a "At least ZE2" so that code of the form:#ifdef ZEND_ENGINE_2
newAPI();
#else /* ZE1 */
oldAPI();
#endifWould continue making sense (modulo newNewAPI() in ZE3, of course).
Was the ZEND_ENGINE_2 define removed on purpose? Or as an accidental
side-effect of a mass update to "We're ZE3 now!"
Afair on purpose.
And I prefer it this way. Many changes are so subtle that we may have way
too many bad bugs in exts if ze2 or later is used. IMHO :)
Cheers,
Pierre
Hey Sara,
I realize that ZE3 is not ZE2, but I always saw the ZEND_ENGINE_2
define as more of a "At least ZE2" so that code of the form:#ifdef ZEND_ENGINE_2
newAPI();
#else /* ZE1 */
oldAPI();
#endifWould continue making sense (modulo newNewAPI() in ZE3, of course).
Was the ZEND_ENGINE_2 define removed on purpose? Or as an accidental
side-effect of a mass update to "We're ZE3 now!"
It was deliberate, I did it. The reason for getting rid of it was because it makes checking ZE2 simpler, actually. I didn't want to have to do #if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_3).
Thanks.
Andrea Faulds
http://ajf.me/
It was deliberate, I did it. The reason for getting rid of it was because it makes checking ZE2 simpler, actually. I didn't want to have to do #if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_3).
So instead you have to do:
#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)
But cool, kind of arbitrary either way, so it's all good.
2015-01-02 20:41 GMT+01:00 Sara Golemon php@golemon.com:
So instead you have to do:
#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)
#ifdef ZEND_ENGINE_3
define ZEND_ENGINE_2
#endif
in php_ext.h, like we had the following for 5.2 compatibles:
#if PHP_VERSION_ID
< 503000
define zend_parse_parameters_none()
zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")
#endif
Bloilerplate code yes, but that is a small cost for cross version
compatibility. Perhaps its time we have a php_compat.h header that is
up to date for such we have in the main distro for all versions
--
regards,
Kalle Sommer Nielsen
kalle@php.net
2015-01-02 20:41 GMT+01:00 Sara Golemon php@golemon.com:
So instead you have to do:
#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)#ifdef ZEND_ENGINE_3
define ZEND_ENGINE_2
#endif
Yeah, obviously I can do that. I'm not actually an idiot, I just
disagree on which of two arbitrary choices seems more obvious.
And since we're pasting unnecessary pieces of obvious code, we could
as easily do:
#ifdef ZEND_ENGINE_3
undef ZEND_ENGINE_2
#endif
Which leaves the decision to make the macros exclusive of each other
an arbitrary one. Just as making them inclusive would have been
equally arbitrary. But thank you for the unnecessary piece of obvious
code.
-Sara
It was deliberate, I did it. The reason for getting rid of it was because it makes checking ZE2 simpler, actually. I didn't want to have to do #if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_3).
So instead you have to do:
#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)But cool, kind of arbitrary either way, so it's all good.
I'm rather more of a fan to actually do:
#if PHP_VERSION_ID
>= 70000 instead anyway....
cheers,
Derick
It was deliberate, I did it. The reason for getting rid of it was
because it makes checking ZE2 simpler, actually. I didn't want to have to
do #if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_3).So instead you have to do:
#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)But cool, kind of arbitrary either way, so it's all good.
I'm rather more of a fan to actually do:
#if
PHP_VERSION_ID
>= 70000 instead anyway....
Yeah, same to me.
I'm used to using something like this :
Julien