Skip to content

Fix GH-24637: Check all parent interface constructors - #24659

Open
HarshitBavaliya wants to merge 2 commits into
php:masterfrom
HarshitBavaliya:fix-gh-24637-interface-constructors
Open

HarshitBavaliya wants to merge 2 commits into
php:masterfrom
HarshitBavaliya:fix-gh-24637-interface-constructors

Conversation

@HarshitBavaliya

Copy link
Copy Markdown

Fixes GH-24637.

An overriding constructor is currently checked against only the single
interface constructor held as its prototype. When a parent implements
multiple interfaces, another interface may impose a stricter signature.
Check a child constructor against each constructor declared by the parent's
implemented interfaces.

Remove the XFAIL from the existing reproducer and document this newly
enforced compatibility error in UPGRADING.

Validation:

  • make -j$(nproc) with --disable-all --enable-cli --disable-cgi --without-pear
  • Both constructor prototype PHPTs pass.
  • Zend inheritance suite: 69 passed, 2 skipped, 0 failed.

This pull request description was prepared with AI assistance.

HarshitBavaliya and others added 2 commits October 24, 2026 23:30
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Child constructor is checked against only one interface constructor, depending on the order of implements

1 participant