Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix php8.2 deprecation - Use of "parent" in callables is deprecated #2015

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ldaspt
Copy link

@ldaspt ldaspt commented Sep 3, 2024

@see https://3v4l.org/dbOp6 when using is_callable('parent::preSave')

Output for 8.2.0 - 8.2.23, 8.3.0 - 8.3.11
    Deprecated: Use of "parent" in callables is deprecated in /in/dbOp6 on line 15
    Foo::preSave
    Bar::preSave
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.29
    Foo::preSave
    Bar::preSave

@see https://3v4l.org/OrSnV when using is_callable([parent::class, 'preSave']), the syntax is also compatible with PHP 7.4, minimal version of the Propel library

Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.23, 8.3.0 - 8.3.11
    Foo::preSave
    Bar::preSave
Output for 5.4.0 - 5.4.45
    Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /in/OrSnV on line 15

    Process exited with code 255.

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.

1 participant