Skip to content

Overhaul constructor page, including PHP 8 promotion.#188

Closed
Crell wants to merge 15 commits intophp:masterfrom
Crell:constructors
Closed

Overhaul constructor page, including PHP 8 promotion.#188
Crell wants to merge 15 commits intophp:masterfrom
Crell:constructors

Conversation

@Crell
Copy link
Copy Markdown
Contributor

@Crell 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.

Copy link
Copy Markdown
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Just a few notes after skimming the changes.

@salathe
Copy link
Copy Markdown
Contributor

salathe commented Nov 18, 2020

Thanks for the much-needed cleanup and update of this page, @Crell. 👍

Copy link
Copy Markdown
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nits but mostly okay. :)

<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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@Crell
Copy link
Copy Markdown
Contributor Author

Crell commented Nov 21, 2020

Seems to be accepted by most, so committed myself: http://svn.php.net/viewvc?view=revision&revision=351474

Hopefully I didn't break anything...

@Crell Crell closed this Nov 21, 2020
@Crell Crell deleted the constructors branch April 30, 2021 17:44
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.

7 participants