rfc:propertygetsetsyntax-alternative-typehinting-syntax

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
rfc:propertygetsetsyntax-alternative-typehinting-syntax [2013/01/20 15:19] – Add patch nikicrfc:propertygetsetsyntax-alternative-typehinting-syntax [2013/01/28 16:11] – Decline nikic
Line 2: Line 2:
   * Date: 2013-01-04   * Date: 2013-01-04
   * Author: Nikita Popov <nikic@php.net>   * Author: Nikita Popov <nikic@php.net>
-  * Status: Under Discussion+  * Status: Declined
  
 ===== Introduction ===== ===== Introduction =====
Line 102: Line 102:
  
 Note that properties are ''null'' initialized by default. The nullability semantics do not (and can not) affect this. They only specify whether it's possible to **assign** ''null'' to the property after initialization. Note that properties are ''null'' initialized by default. The nullability semantics do not (and can not) affect this. They only specify whether it's possible to **assign** ''null'' to the property after initialization.
 +
 +Default values can only be used on the shorthand notation. If accessor methods are specified a default value can not be used. The only exception is the ''= null'' default, which can still be used to specify nullability:
 +
 +<code php>
 +public DateTime $date = null {
 +    get { ... } set { ... }
 +}
 +</code>
  
 ===== Benefits of the proposed syntax ===== ===== Benefits of the proposed syntax =====
Line 150: Line 158:
  
 The patch for this proposal is available here: https://gist.github.com/4579298. You can find the individual commits here: https://github.com/nikic/php-src/commits/alternativeSyntax. The patch for this proposal is available here: https://gist.github.com/4579298. You can find the individual commits here: https://github.com/nikic/php-src/commits/alternativeSyntax.
 +
 +===== Voting =====
 +
 +This proposal depends on the main accessors RFC. The result of this vote is only relevant if the main RFC is accepted. As this is a language change it requires a 2/3 majority.
 +
 +<doodle title="Should the proposed typehinting syntax be used instead of the current one?" auth="nikic" voteType="single" closed="true">
 +   * Yes
 +   * No
 +</doodle>
 +
 +The vote ended 3 in favor, 12 against, as such this feature is declined.
rfc/propertygetsetsyntax-alternative-typehinting-syntax.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1