Re: Porting Extension to PHP7
| From: | Dan Ackroyd | Date: | Wed, 25 Jul 2018 20:22:49 +0000 |
| Subject: | Re: Porting Extension to PHP7 | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-15435@lists.php.net to get a copy of this message | ||
On 24 July 2018 at 00:13, Johannes Findeisen <mailman@hanez.org> wrote:
> Hello,
>
> Are there any good information somewhere on how to do porting right?
A lot of information is here: https://wiki.php.net/phpng-upgrading
> Is it possible to port it to PHP7 and stay PHP5 compatible?
Yes, through the copious use of macros.
The source for Imagick compiles against 5.3 to 7.3 with the use of
macros https://github.com/mkoppanen/imagick
The only parts that were difficult to do on a line-by-line level were
the pieces of code that operate over arrays, where the code has
changed so much it was easier to duplicate the whole functions, rather
than wrapping individual lines in #ifdef's.
I don't read this mailing list frequently - feel free to ping me on
twitter if you have a specific question about a difficult bit
https://twitter.com/MrDanack/
cheers
Dan
Ack