Re: [RFC Discussion] Typed Properties
| From: | Phil Sturgeon | Date: | Wed, 16 Mar 2016 19:29:55 +0000 |
| Subject: | Re: [RFC Discussion] Typed Properties | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91710@lists.php.net to get a copy of this message | ||
On Wed, Mar 16, 2016 at 1:39 PM, Johannes Schlüter
<johannes@schlueters.de> wrote:
> 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
>
>
Hey there!
I put your code into 3v4l so you could see what would happen:
https://3v4l.org/taC8D
Fatal error: Uncaught TypeError: Typed property A::$i must not be referenced
Is that what you expect? If not, what would you expect?