Previously we called set_error_handler() in tests.php to do this, but
that only sets it for the test-suite. Now we set it in on the PHP
command line, which works for both.
Specifying CPP11=1 also passes -std=c++11 to the compiler, which is
really unhelpful here as that disables all GNU extensions which breaks
the PHP C API headers.
Make it work with how globals are actually wrapped. It looks like
this example has never been right, but nobody noticed before PHP 8
started warning about the use of unset variables.
This reveals that handling of std::string properties needs fixing.
Building once with a different compiler on a different platform is
useful, but running multiple builds for languages I'm not working
on is a waste of donated CPU time, and having CI reported as failing
because the Python builds on cygwin aren't currently working is
downright unhelpful.
This isn't really workable since PHP doesn't support intercepting
accesses to global variables (nor to static class properties, so
we can't wrap C/C++ global variables that way either).
The _get() and _set() function wrappers actually work and have
been generated for a very long time.
Stop filtering /^new_/ - we no longer generate these for classes, so
only the li_carrays and li_carrays_cpp testcases generate new_* flat
functions, and it's helpful to check those are generated.
Stop filtering /_(alter|get)_newobject$/' - we no longer generate
these, as they weren't used or documented.
These were deprecated nearly 20 years ago and attempts to use them
have generated a deprecation warning for most of that time.
Addresses #1984 for PHP.
These were added as part of the changes to add director support for
PHP, but have never actually been used by anything SWIG generates,
and they aren't documented so shouldn't be used externally.
Removing these exposed a bug in the arginfo generation where we emitted
a ZEND_ARG_INFO for a varargs "parameter", which this commit also fixes.
Mark the parameter as "byref" and write back through the reference
after the call.
Adjust testcase argout to uncomment the part that's meant to test this,
and to remove lingering traces of PHP's old call-time pass-by-reference
(which was completely removed before PHP 7).
Fixes#1457
Use zend_call_known_instance_method() instead of call_user_function(),
since this way PHP seems to know that context of the call is from within
the same object.
Fixes testcases director_nested and director_protected which were giving
errors for PHP 8 and warnings for PHP 7.
These names lack a "SWIG_" prefix to help prevent collisions with code
being wrapped, but they're each only used in one place so just inline
them there.