PHP 7.4: new RemovedOrphanedParent sniff by jrfnl · Pull Request #818 · PHPCompatibility/PHPCompatibility

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@jrfnl

Copy link Copy Markdown

Member

@jrfnl jrfnl commented

Jun 14, 2019

  • Core
    Using "parent" inside a class without parent is deprecated, and will throw
    a compile-time error in the future. Currently an error will only be
    generated if/when the parent is accessed at run-time.

Refs:

Loosely related to #808


I've opted to add this sniff to the Classes category as the use of the parent keyword in a class without parent requires examining the class declaration statement, though it can be argued that it should be in the Keywords category as the focus is on the parent keyword.

> - Core
>    Using "parent" inside a class without parent is deprecated, and will throw
>    a compile-time error in the future. Currently an error will only be
>    generated if/when the parent is accessed at run-time.

Refs:
* https://github.com/php/php-src/blob/42cc58ff7b2fee1c17a00dc77a4873552ffb577f/UPGRADING#L303
* php/php-src#3404
* php/php-src#3564
* php/php-src@a9e6667 (originally committed as hard compile time error)
* php/php-src@deb44d4 (reverted back to deprecation error)

@wimg wimg merged commit b8db795 into master

Jun 16, 2019

@delete-merged-branch delete-merged-branch bot deleted the php-7.4/deprecated-parent-in-class-without-parent branch

June 16, 2019 13:15

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

Reviewers

@wimg wimg wimg approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

9.2.0

Development

Successfully merging this pull request may close these issues.

2 participants

@jrfnl @wimg