Re: [RFC][Vote] Typed Properties
| From: | Thomas Bley | Date: | Wed, 25 May 2016 22:17:27 +0000 |
| Subject: | Re: [RFC][Vote] Typed Properties | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-93545@lists.php.net to get a copy of this message | ||
Currently the rfc also checks the properties for being initialized.
I think it's still faster than most userland implementations using __get() for type checks and
parsing phpdoc for type information.
Regards
Thomas
Stanislav Malyshev wrote on 25.05.2016 23:56:
> Hi!
>
>> var_dump($a->w); // Fatal error, uninitialized...
>
> This means every read access to a property should be checked for it
> being typed, and every access to a typed property should be checked for
> it being initialized. I'm concerned there might be a performance hit for
> this.
>
> Also, this means no access for a property - even defined one - is safe,
> and if you want to avoid fatal errors, you need to check every access,
> at least if you suspect typed properties may be involved. And, of
> course, there's no function in the RFC to actually check it.
> --
> Stas Malyshev
> smalyshev@gmail.com
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>