Re: Idea: use stub.php and arginfo.h in PHP 7.x
| From: | Remi Collet | Date: | Mon, 05 Oct 2020 14:53:05 +0000 |
| Subject: | Re: Idea: use stub.php and arginfo.h in PHP 7.x | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-16977@lists.php.net to get a copy of this message | ||
Le 23/04/2020 à 14:40, Remi Collet a écrit :
> Hi,
>
> One interesting feature of PHP 8 is the automatic
> generation of arginfo from a stub file.
If you want to have a simple arginfo header for old version
you can use, in your stub
/**
* @generate-function-entries
* @generate-legacy-arginfo
*/
This will generate 2 headers
- foo_arginfo.c with type hinting for PHP 8
- foo_legacy_arginfo.c for older PHP versions
Remi
P.S. available in master, will be in RC2