Hi everyone,
As a first time poster I'm very nervous but here we go! I've recently
upgraded my development environment to PHP 7. Everything works amazing
however 1 module I used to use a lot is not ported yet to PHP 7. I've
notified the creator but I thought this also may be a good opportunity to
see if I can get some more knowledge about this subject.
I cloned the github repo and was able to remove 1 error during the
compilation process that had to do with ZVAL_STRING. This was an easy error
to fix since it came down to simply removing an argument. I've read
https://wiki.php.net/phpng-upgrading but still I feel like there should be
more resources available after seeing the amount of extensions that are
already successfully converted for PHP 7. For example I'm now stuck how to
fix an error like:
"error: too many arguments to function ‘zend_hash_get_current_key_ex’"
Googling won't really help since most results return posts of people who
fail to install modules.
How can I continue with making this work? Any good (up-to-date) resources?
An IRC channel where I can help?
Sjoerd Maessen in php.internals (Thu, 10 Dec 2015 17:51:56 +0100):
As a first time poster I'm very nervous but here we go! I've recently
upgraded my development environment to PHP 7. Everything works amazing
however 1 module I used to use a lot is not ported yet to PHP 7.
Which extension are we talking about?
Jan
Hi,
----- Mail original -----
De: "Sjoerd Maessen" sjoerd.maessen@gmail.com
À: internals@lists.php.net
Envoyé: Jeudi 10 Décembre 2015 17:51:56
Objet: [PHP-DEV] Converting an 'old' PHP 5.x extension to PHP 7Hi everyone,
As a first time poster I'm very nervous but here we go! I've recently
upgraded my development environment to PHP 7. Everything works
amazing
however 1 module I used to use a lot is not ported yet to PHP 7. I've
notified the creator but I thought this also may be a good
opportunity to
see if I can get some more knowledge about this subject.I cloned the github repo and was able to remove 1 error during the
compilation process that had to do with ZVAL_STRING. This was an easy
error
to fix since it came down to simply removing an argument. I've read
https://wiki.php.net/phpng-upgrading but still I feel like there
should be
more resources available after seeing the amount of extensions that
are
already successfully converted for PHP 7. For example I'm now stuck
how to
fix an error like:"error: too many arguments to function
‘zend_hash_get_current_key_ex’"Googling won't really help since most results return posts of people
who
fail to install modules.How can I continue with making this work? Any good (up-to-date)
resources?
An IRC channel where I can help?
pecl-compat include files (https://github.com/flaupretre/pecl-compat) may help, but porting an extension from PHP 5 to 7 remains a complex operation, and there's not so much information available. Unfortunately, compiling without error is generally not enough. Anyway, it does greatly depend on your extension. Some 'pure-bridge' extensions are relatively easy to port. Can you please indicate which extension you are considering ?
Regards
François
As a first time poster I'm very nervous but here we go!
Welcome!
I cloned the github repo and was able to remove 1 error during the
compilation process that had to do with ZVAL_STRING. This was an easy error
to fix since it came down to simply removing an argument. I've read
https://wiki.php.net/phpng-upgrading but still I feel like there should be
more resources available after seeing the amount of extensions that are
already successfully converted for PHP 7. For example I'm now stuck how to
fix an error like:"error: too many arguments to function ‘zend_hash_get_current_key_ex’"
We don't really have comprehensive documentation of how internal APIs
have changed from 5 to 7. Beyond the things noted on the phpng and
phpng-upgrading pages on the wiki, the best resource is probably
lxr.php.net, where you can look up a definition on both the PHP-5.6
and PHP-7.0 branches and see how they've changed.
For the most part, extension API changes are largely around things
like removing indirection on zvals, HashTables now containing zvals
rather than void pointers, and strings being represented as
zend_string structs rather than paired char * and int pointers.
How can I continue with making this work? Any good (up-to-date) resources?
An IRC channel where I can help?
There is #php.pecl on efnet — it's not the highest traffic channel,
but if you're patient there'll generally be someone around who can
help.
Adam
Hi Jan, François and Adam,
Thank you for the quick responses. Ah yes an extension name can be helpful.
I’m talking about the extension “php-svm” of Ian Barber (
https://github.com/ianbarber/php-svm) which I made a fork of
https://github.com/sjoerdmaessen/php-svm
Regards,
Sjoerd
On 10 December 2015 at 08:51, Sjoerd Maessen sjoerd.maessen@gmail.com
wrote:As a first time poster I'm very nervous but here we go!
Welcome!
I cloned the github repo and was able to remove 1 error during the
compilation process that had to do with ZVAL_STRING. This was an easy
error
to fix since it came down to simply removing an argument. I've read
https://wiki.php.net/phpng-upgrading but still I feel like there should
be
more resources available after seeing the amount of extensions that are
already successfully converted for PHP 7. For example I'm now stuck how
to
fix an error like:"error: too many arguments to function ‘zend_hash_get_current_key_ex’"
We don't really have comprehensive documentation of how internal APIs
have changed from 5 to 7. Beyond the things noted on the phpng and
phpng-upgrading pages on the wiki, the best resource is probably
lxr.php.net, where you can look up a definition on both the PHP-5.6
and PHP-7.0 branches and see how they've changed.For the most part, extension API changes are largely around things
like removing indirection on zvals, HashTables now containing zvals
rather than void pointers, and strings being represented as
zend_string structs rather than paired char * and int pointers.How can I continue with making this work? Any good (up-to-date)
resources?
An IRC channel where I can help?There is #php.pecl on efnet — it's not the highest traffic channel,
but if you're patient there'll generally be someone around who can
help.Adam