Re: Automatic implementation of Stringable may conflict with old, untyped arginfo declarations
| From: | Dan Ackroyd | Date: | Thu, 09 Dec 2021 20:08:41 +0000 |
| Subject: | Re: Automatic implementation of Stringable may conflict with old, untyped arginfo declarations | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-116610@lists.php.net to get a copy of this message | ||
On Wed, 8 Dec 2021 at 16:02, Jeremy Mikola <jmikola@gmail.com> wrote:
>
>
> We haven't explored using stubs, but I'll keep that in mind. ...
> (which we plan to do since we finally dropped support for PHP
> 7.1).
>
FYI, the stub files maintain #ifdef info through their processing,
which allows some useful shenanigans* e.g.:
https://github.com/Imagick/imagick/blob/86d95fed787d60db110ccfeb2d89ec53f1d1f5f7/Imagick.stub.php#L168-L182
https://github.com/Imagick/imagick/blob/86d95fed787d60db110ccfeb2d89ec53f1d1f5f7/Imagick_arginfo.h#L748-L778
So the stubs are used to generate arg info for Imagick from PHP 5.4 to
8.1, across lots of versions of ImagickMagick.
I'm finding managing function signatures in a PHP file, in standard
PHP format, is a lot nicer than maintaing that info in C files.
cheers
Dan
Ack
* Though, tbh, I wished I'd known about /** @generate-legacy-arginfo
*/ before doing some of the hacks in the Imagick regen_arginfo.sh
script.