[php] Omit incompatible return type declaraction

Under %feature("php:type", "compat") we don't generate return type
declaration for virtual methods if directors are enabled for that class.
However if a base class of the class has a method of the same name which
isn't directed this was still getting a return type declaration which
caused PHP to give an error when it tried to load the module.

Now we detect this situation and suppress the base class method's
return type declaration too.

Re-enable testcase director_redefined which now works again (it was
failing under PHP8 due to this issue).

See #2151
This commit is contained in:
Olly Betts 2022-07-13 16:01:59 +12:00
commit 64fa88c0eb
2 changed files with 23 additions and 14 deletions

View file

@ -26,10 +26,6 @@ C_TEST_CASES += \
li_cdata_carrays \
multivalue \
# These fail with PHP8 currently. Aiming to fix before 4.1 release. See #2151.
FAILING_CPP_TESTS = \
director_redefined
include $(srcdir)/../common.mk
# Overridden variables here