Hi Remi,

If we use this stub.php file to generate an arginfo.h file, should the src
package of extension contain stub.php or not?

BTW, thank you for your tips!



Remi Collet <r...@fedoraproject.org> 于2020年4月23日周四 下午8:40写道:

> Hi,
>
> One interesting feature of PHP 8 is the automatic
> generation of arginfo from a stub file.
>
>
> Just thinking if this can be used for PECL extension
> and used in PHP 7 compatible version.
>
>
> A WIP exists in xattr [1] extension
>
>
> How it works:
>
> - arginfo are only generated when the extension is build
>   against PHP 8, so most of the work must be done there
>
> - Build against PHP 7 will use the same file
>
> - stub.php may have some conditional for PHP 8 new features
>   (e.g. union type usage)
>
> - some compat macro defined before including arginfo.h
>   may be needed (e.g. ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE)
>
>
> At a first glance, it seems working and nice to use
>
>
> Comment welcome about this.
>
>
>
> Remi
>
>
> [1] https://github.com/php/pecl-file_system-xattr
>
>

Reply via email to