Re: [RFC] Property Accessors v1.2 : Extra shorthand declaration
| From: | Jazzer Dane | Date: | Fri, 26 Oct 2012 10:53:19 +0000 |
| Subject: | Re: [RFC] Property Accessors v1.2 : Extra shorthand declaration | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-63644@lists.php.net to get a copy of this message | ||
Is the only intended benefit behind this proposal the ability to seamlessly
extend a seemingly normal property as an accessor?
On Fri, Oct 26, 2012 at 3:43 AM, Clint Priest <cpriest@zerocue.com> wrote:
> I'm opening up several new threads to get discussion going on the
> remaining "being debated" categories referenced in this 1.1 -> 1.2 change
> spec:
> https://wiki.php.net/rfc/**propertygetsetsyntax-as-**
>
> implemented/change-requests<https://wiki.php.net/rfc/propertygetsetsyntax-as-implemented/change-requests>
>
> ------------------------------**------------------------------**
> ------------
> *Extra shorthand declaration*
>
> Allow extra short declaration of an accessor:
>
> class TimePeriod {
> public DateTime $date;
> }
>
> /* Would be equivalent to this */
>
> class TimePeriod {
> public $date {
> get() { return $this->date; }
> set(DateTime $value) { $this->date = $value;}
> }
> }
>
> ------------------------------**------------------------------**
> ------------
> Thoughts?
>
> --
> -Clint
>
>