summaryrefslogtreecommitdiff
path: root/Lib/php
diff options
context:
space:
mode:
authorOlly Betts <olly@survex.com>2022-01-21 12:11:39 +1300
committerOlly Betts <olly@survex.com>2022-01-21 12:11:39 +1300
commitce4a9923ed123a054381edc7858c8a2379657076 (patch)
tree1a4049598a07ae6d35d5deb068fff994e73f996e /Lib/php
parent4d3d4839b094cf64f8bbe490e1108a1bb821b214 (diff)
downloadswig-ce4a9923ed123a054381edc7858c8a2379657076.tar.gz
[php] Fix zend_class_implements_interface() compat
The sense of parameter 3 of instanceof_function_ex() appears to have changed in PHP 7.4 and we need to pass 0 for older versions and 1 for PHP 7.4. Words fail me.
Diffstat (limited to 'Lib/php')
-rw-r--r--Lib/php/phprun.swg7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/php/phprun.swg b/Lib/php/phprun.swg
index 97d17d9ca..005cf9eba 100644
--- a/Lib/php/phprun.swg
+++ b/Lib/php/phprun.swg
@@ -96,7 +96,12 @@ static int default_error_code = E_ERROR;
static zend_class_entry SWIG_Php_swig_wrapped_interface_ce;
#if PHP_MAJOR_VERSION == 7
-# define zend_class_implements_interface(C, I) instanceof_function_ex(C, I, 1)
+/* The sense of parameter 3 of instanceof_function_ex() changed in PHP 7.4!
+# if PHP_MINOR <= 3
+# define zend_class_implements_interface(C, I) instanceof_function_ex(C, I, 0)
+# else
+# define zend_class_implements_interface(C, I) instanceof_function_ex(C, I, 1)
+# endif
#endif
/* used to wrap returned objects in so we know whether they are newobject