[php] Fix reserved class names TRUE, FALSE, NULL
PHPCN(x) does a string compare of x with the lower-cased class name,
so x needs to be in lowercase or else the entry has no effect. The
entries for TRUE, FALSE and NULL weren't working as a result.
diff --git a/Examples/test-suite/php_namewarn_rename.i b/Examples/test-suite/php_namewarn_rename.i
index d84e219..bb54dba 100644
--- a/Examples/test-suite/php_namewarn_rename.i
+++ b/Examples/test-suite/php_namewarn_rename.i
@@ -5,6 +5,9 @@
%warnfilter(SWIGWARN_PARSE_KEYWORD) stdClass;
%warnfilter(SWIGWARN_PARSE_KEYWORD) directory;
%warnfilter(SWIGWARN_PARSE_KEYWORD) Hello::empty();
+%warnfilter(SWIGWARN_PARSE_KEYWORD) null;
+%warnfilter(SWIGWARN_PARSE_KEYWORD) True;
+%warnfilter(SWIGWARN_PARSE_KEYWORD) FALSE;
#endif
%ignore prev::operator++;
@@ -36,4 +39,15 @@
prev operator++(int) { return *this; }
};
+ class null
+ {
+ };
+
+ class True
+ {
+ };
+
+ class FALSE
+ {
+ };
%}
diff --git a/Lib/php/phpkw.swg b/Lib/php/phpkw.swg
index e199eac..e431fc2 100644
--- a/Lib/php/phpkw.swg
+++ b/Lib/php/phpkw.swg
@@ -623,7 +623,8 @@
PHPBN2(PGSQL_POLLING_READING);
PHPBN2(PGSQL_POLLING_WRITING);
-/* Class names reserved by PHP (case insensitive) */
+/* Class names reserved by PHP. */
+/* Check is case insensitive - these *MUST* be listed in lower case here. */
PHPCN(directory);
PHPCN(stdclass);
PHPCN(__php_incomplete_class);
@@ -639,9 +640,9 @@
PHPCN(int); // As of PHP 7.0
PHPCN(float); // As of PHP 7.0
PHPCN(string); // As of PHP 7.0
-PHPCN(NULL); // As of PHP 7.0
-PHPCN(TRUE); // As of PHP 7.0
-PHPCN(FALSE); // As of PHP 7.0
+PHPCN(null); // As of PHP 7.0
+PHPCN(true); // As of PHP 7.0
+PHPCN(false); // As of PHP 7.0
PHPCN(resource); // As of PHP 7.0 (currently works but reserved)
PHPCN(object); // As of PHP 7.0 (currently works but reserved)
PHPCN(mixed); // As of PHP 7.0 (currently works but reserved)