Hello Christian,

Sunday, May 18, 2008, 7:16:55 PM, you wrote:

> Hi Marcus,

> Am 18.05.2008 um 18:41 schrieb Marcus Boerger:
>> Just to make this clear once and for ever. If unset() deletes the  
>> property then:
>> a) it would break inheritance
>> b) accomplish nothing, as the next access would simply recreate it

> Ok, you don't want this thread to die, so here we go: You keep on  
> repeating your two points, care to show some code demonstrating it?

> Contradicting tests:
> class A { var $foo = 42; }

> $a = new A;
> var_dump($a);
> # Output: object(A)#2 (1) {  ["foo"]=> int(42) }

> $a->foo = null;
> var_dump($a);
> # Output: object(A)#2 (1) { ["foo"]=> NULL }

> unset($a->foo);
> var_dump($a);
> # Output: object(A)#2 (0) { }

> $x = $a->foo;
> var_dump($a);
> # Output: object(A)#2 (0) { }

> This is exactly the same behaviour as for any variable, nothing broken  
> here.
> Can we please move on now?

A member variable simply is not like any other variable. It is being
declared and part of an interface. Removing it means changing the
interface means breaking inheritance. So making this possible is a bug in
the engine. End of the story.

Best regards,
 Marcus


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

Reply via email to