Skip to content

fix(php): call parent constructor only if it exists in parent class#7810

Open
Michal-Pinchasi wants to merge 2 commits into
microsoft:mainfrom
Michal-Pinchasi:fix/php-parent-constructor-bug
Open

fix(php): call parent constructor only if it exists in parent class#7810
Michal-Pinchasi wants to merge 2 commits into
microsoft:mainfrom
Michal-Pinchasi:fix/php-parent-constructor-bug

Conversation

@Michal-Pinchasi

@Michal-Pinchasi Michal-Pinchasi commented Jun 18, 2026

Copy link
Copy Markdown

Description

Fixes a bug where parent::__construct(); is generated even if the parent class has no constructor, causing runtime crashes in PHP.

Changes

  • Added a check using parentClass.Methods.Any(...) before writing the constructor parent call.

@Michal-Pinchasi Michal-Pinchasi requested a review from a team as a code owner June 18, 2026 20:16
@WolfgangHG

Copy link
Copy Markdown
Contributor

Resolves #7809

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants