-
Notifications
You must be signed in to change notification settings - Fork 135
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
Remove default value for parameter followed by required parameter #87
Conversation
Parameter with default value followed by required parameter is deprecated in PHP 8. Just removing the default values should not lead to a change in functionality. [Ref](https://www.php.net/manual/en/migration80.deprecated.php#migration80.deprecated.core)
I just realized there is another pull request for this. I think removing the default values is a better fix than adding one for the last parameter, as the key Anyhow, one of these fixes should be merged as soon as possible to get rid of the deprecation notice in PHP 8. |
It is worth pointing out there is no visibility on the method and by default this is Having said that it is not in the docs and an internal function. Either way it makes no difference to me, I am with @Stadly and the priority should be getting PHP8 support. We are using Yii2, and they promote warnings to exceptions which makes this is a bigger issue. |
I don't think this is a breaking change. Calling
Therefor To my understanding, removing the defaults should not introduce any issues for classes extending the class. Hence there should be no BC break. Or am I missing something? |
@Stadly you are correct it was me that was missing something. With the last parameter not having a default value you need to pass in all the parameters, all existing implementations will need to be passing all parameters in. I am with you and calling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@soundasleep I would like to express my support for this PR and, as this would fix PHP8 support, it should be merged ASAP, if you please.
Any Update on this PR? |
I could use this PR if there's a chance, this is the one thing stopping me from switching to php8 |
I made a temporary fork of this PR so that I can continue running this package on my PHP 8 project. Might be useful for some of you too.
|
Parameter with default value followed by required parameter is deprecated in PHP 8. Just removing the default values should not lead to a change in functionality. Ref