Re: [RFC Discussion] Typed Properties

From: Date: Wed, 16 Mar 2016 17:50:23 +0000
Subject: Re: [RFC Discussion] Typed Properties
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-91701@lists.php.net to get a copy of this message
> Am 16.03.2016 um 18:39 schrieb Johannes Schlüter <johannes@schlueters.de>: > > On Wed, 2016-03-16 at 12:36 -0400, Phil Sturgeon wrote: >> Hello everyone, >> >> I have completed the draft for an RFC, to add Typed Properties. The >> patch has been written by the one and only Joe Watkins. >> >> https://wiki.php.net/rfc/typed-properties > > I'm no fan of all this typing business, but that's a lost case. Anyways: > What about references? (yeah, references should die, but currently they > still exist) > > What's expected here: > > class A { > public int $i; > } > > $a = new A(); > $r = &$a->i; > $r = "foobar"; > > johannes The patch currently prevents that. It prevents all creation of references to properties. The reason is technical: We'd basically need typed zvals. Or add some sort of write callback to typed references. If you have a clean solution to these issues, you're more than welcome to contribute here. Bob

« previous php.internals (#91701) next »