Skip to content

[PHP] FIXES #9171 Return type not added to constructor override#9234

Open
DamImpr wants to merge 1 commit intoapache:masterfrom
DamImpr:fix-php-override-constructor
Open

[PHP] FIXES #9171 Return type not added to constructor override#9234
DamImpr wants to merge 1 commit intoapache:masterfrom
DamImpr:fix-php-override-constructor

Conversation

@DamImpr
Copy link

@DamImpr DamImpr commented Feb 26, 2026

As reported in issue #9171 adding the return type to the constructor in a PHP project caused a conflict with the ‘override methods’ feature, making the code incompatible with PHP inheritance rules.

This PR removes the return type from the constructor, restoring compatibility with PHP conventions and resolving the reported bug.
Effect: the constructor can now be correctly overridden in child classes, as expected by the language.

@geek998
Copy link

geek998 commented Feb 26, 2026

Good job! very useful

@mbien mbien added PHP [ci] enable extra PHP tests (php/php.editor) ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Feb 26, 2026
@apache apache locked and limited conversation to collaborators Feb 26, 2026
@apache apache unlocked this conversation Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) PHP [ci] enable extra PHP tests (php/php.editor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[PHP] 'Generate override' feature assigns the return type in the constructor

3 participants