Overhaul constructor page, including PHP 8 promotion.#188
Closed
Crell wants to merge 15 commits intophp:masterfrom
Closed
Overhaul constructor page, including PHP 8 promotion.#188Crell wants to merge 15 commits intophp:masterfrom
Crell wants to merge 15 commits intophp:masterfrom
Conversation
Contributor
Crell
commented
Nov 17, 2020
- Clean out leftover PHP 5 content.
- Mention constructor arguments at all, which were not mentioned previously. 😄
- Document constructor property promotion.
- Describe the static-constructor pattern, which is a better alternative to multiple-constructors than about 20 different comments on the page, all of which were giving awful, awful advice in that regard. They have now been removed.
cmb69
reviewed
Nov 17, 2020
Member
cmb69
left a comment
There was a problem hiding this comment.
Thanks for the PR! Just a few notes after skimming the changes.
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
salathe
reviewed
Nov 17, 2020
Contributor
|
Thanks for the much-needed cleanup and update of this page, @Crell. 👍 |
Girgias
reviewed
Nov 19, 2020
Member
Girgias
left a comment
There was a problem hiding this comment.
Small nits but mostly okay. :)
language/oop5/decon.xml
Outdated
| <para> | ||
| Object properties may not be typed <type>callable</type> due to engine ambiguity that would | ||
| introduce. Promoted arguments, therefore, may not be typed <type>callable</type> either. Any | ||
| other legal type is permitted, however. |
Member
There was a problem hiding this comment.
Maybe would be better to link to the new type declaration page as union types are also valid, this page also mentions that callable cannot be used as a property type.
Co-authored-by: George Peter Banyard <7906688+Girgias@users.noreply.github.com>
Girgias
reviewed
Nov 19, 2020
Girgias
reviewed
Nov 19, 2020
Contributor
Author
|
Seems to be accepted by most, so committed myself: http://svn.php.net/viewvc?view=revision&revision=351474 Hopefully I didn't break anything... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.