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?
Regards,
- Chris
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php