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
> smalys...@gmail.com
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to