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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to