Don't special case NULL in the REF in typemap

PHP doesn't accept literal NULL for a parameter passed by reference;
passing a variable with a value of NULL is just like passing a
variable with a different value - we get a PHP reference to the
variable, not NULL.
This commit is contained in:
Olly Betts 2021-04-20 16:22:40 +12:00
commit 26f218327b

View file

@ -2,11 +2,7 @@
%typemap(in, byref=1) TYPE *REF ($*1_ltype tmp), %typemap(in, byref=1) TYPE *REF ($*1_ltype tmp),
TYPE &REF ($*1_ltype tmp) TYPE &REF ($*1_ltype tmp)
%{ %{
/* First Check for SWIG wrapped type */ if (Z_ISREF($input)) {
if (Z_ISNULL($input)) {
$1 = 0;
} else if (Z_ISREF($input)) {
/* Not swig wrapped type, so we check if it's a PHP reference type */
CONVERT_IN(tmp, $*1_ltype, $input); CONVERT_IN(tmp, $*1_ltype, $input);
$1 = &tmp; $1 = &tmp;
} else { } else {