Skip to content

Fix #74269 - Strict comparison of initial trait property values #2468

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

Closed
wants to merge 2 commits into from

Conversation

pmmaga
Copy link
Contributor

@pmmaga pmmaga commented Apr 10, 2017

Link for bugsnet: https://bugs.php.net/bug.php?id=74269

Given the potential BC break, should probably be only for master.

@nikic nikic added the Bug label Apr 10, 2017
@Fleshgrinder
Copy link
Contributor

Isn't this a case for typed properties? As it stands right now, properties in PHP are untyped, hence, the assignment is legal.

@pmmaga
Copy link
Contributor Author

pmmaga commented Apr 11, 2017

@Fleshgrinder in this it is not much about the type, but about the initial value. From the docs on traits:

If a trait defines a property then a class can not define a property with the same name unless it is compatible (same visibility and initial value), otherwise a fatal error is issued.

@Fleshgrinder
Copy link
Contributor

I see, all fine. 👍

@krakjoe
Copy link
Member

krakjoe commented Apr 17, 2017

Can you include an entry to UPGRADING please.

@pmmaga
Copy link
Contributor Author

pmmaga commented Apr 18, 2017

I have added the entry to UPGRADING.

@nikic
Copy link
Member

nikic commented May 1, 2017

Merged as 92124f9, thanks!

@nikic nikic closed this May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants