Combining two things noted previously:
1 - Unsetting an object member removes it from the object completely, subsequent uses of that member will be handled by magic methods.
2 - PHP will not recursively call one magic method from within itself (at least for the same $name).
This means that if an object member has been unset(), it IS possible to re-declare that object member (as public) by creating it within your object's __set() method, like this:
<?php
class Foo
{
function __set($name, $value)
{
$this->$name= $value;
}
}
$foo = new Foo();
var_dump($foo);
$foo->bar = 'something'; var_dump($foo);
$foo->bar = 'other thing';
?>
Also be mindful that if you want to break a reference involving an object member without triggering magic functionality, DO NOT unset() the object member directly. Instead use =& to bind the object member to any convenient null variable.