Rasmus Lerdorf in php.internals (Thu, 05 Feb 2015 17:28:37 -0500):
>We have had quite a number of changes to the extension API and it
>worries me a little bit how long it will take everyone to get their
>extensions ported. We have UPGRADING.INTERNALS which still needs some
>love, but even if that covered everything it is sometimes hard to match
>a bullet point in a long list of changes to actual code.

UPGRADING.INTERNALS is far from complete. Take for instance the
substantial changes in zend_hash_index_find(_ptr). Look at
PHP_FUNCTION(dba_list) in dba.c. In PHP 5.6 that is

if (zend_hash_index_find(&EG(regular_list), i, (void **) &le)==FAILURE)
{
        continue;
}

PHP7:
if ((le = zend_hash_index_find_ptr(&EG(regular_list), i)) == NULL) {
        continue;
}

You'll have to use another macro, with a different number of arguments
and a different false test. There is nothing in UPGRADING.INTERNALS on
this. The info on this change can be found in the Wiki:
https://wiki.php.net/phpng-upgrading

But the wiki on its turn is not complete either. For instance it still
mentions

ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, link_id,
LE_LINK, le_link, le_plink);

Since the API cleanup interbase does not compile anymore. The reason is
that the API cleanup brought substantial changes in
ZEND_FETCH_RESOURCE2. I guess this command now must be something like

ib_link = (ibase_db_link *)zend_fetch_resource2(Z_RES_P(link_arg),
link_id, LE_LINK, le_link, le_plink);

But this is only an educated guess based on looking at changes in other
extensions. At the moment I am struggling with the PHP7 translation of
this block:

#define GET_MOVIE_RESOURCE(ff_movie_ctx) {\
  zval **_tmp_zval;\
  if (zend_hash_find(Z_OBJPROP_P(getThis()), "ffmpeg_movie",\
    sizeof("ffmpeg_movie"), (void **)&_tmp_zval) == FAILURE) {\
    zend_error(E_WARNING, "Invalid ffmpeg_movie object");\
    RETURN_FALSE;\
  }\
\
  ZEND_FETCH_RESOURCE2(ff_movie_ctx, ff_movie_context*, _tmp_zval, -1,\
    "ffmpeg_movie", le_ffmpeg_movie, le_ffmpeg_pmovie);\
}\

I have tried a lot of things, but nothing works so far...

An annotated diff would be very welcome! But more or less complete
documentation as well.

Jan

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to