[php] Generate PHP type declarations

We now automatically generate PHP type declarations for PHP >= 8.0.

The generated code still compiles with PHP 7.x but without type declarations.
This commit is contained in:
Olly Betts 2022-01-20 10:07:44 +13:00 committed by GitHub
commit 1f1349741f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 536 additions and 196 deletions

View file

@ -63,12 +63,12 @@
}
%enddef
%define %pass_by_val( TYPE, CONVERT_IN )
%typemap(in) TYPE
%define %pass_by_val( TYPE, PHP_TYPE, CONVERT_IN )
%typemap(in, phptype=PHP_TYPE) TYPE
%{
CONVERT_IN($1,$1_ltype,$input);
%}
%typemap(in) const TYPE & ($*1_ltype temp)
%typemap(in, phptype=PHP_TYPE) const TYPE & ($*1_ltype temp)
%{
CONVERT_IN(temp,$*1_ltype,$input);
$1 = &temp;