Hi!

> Because if you unset() a property it's type is not guaranteed anymore.

Can't we fix it? I mean, when we unset property on an object, we're
still keeping the definition in the class, right? Can't we use it?

> 
> <?php
> class Foo () {
>   int $a = 0;
> }
> $a = new Foo();
> $b = $a->x + 5; /* we know $a->x is "int" and may use optimized code */
> unset($a->x);
> $b = $a->x + 5; /* $a->x is not "int" any more  and we can't use
> optimized code */

Can't we assume $a->x is still "int" here in a way - I mean, we'd still
have to allow for the possibility of null, but if we say that any one
could be null it's just one easy check, so it won't hurt performance too
much, not?

-- 
Stas Malyshev
smalys...@gmail.com

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

Reply via email to