Am 14.05.2008 um 02:06 schrieb Marcus Boerger:
So you are saying that
$o_Foo->bar = array(42);
is ok when the class "expects" a string but
unset($o_Foo->bar);
or (as as slight variation)
$o->Foo->bar = null;
is not?
I Do not get the connection here? And since when can we 'expect' a
string
only for a property?
You stated that allowing unset() is a bug. I replied that unset() is
not different from setting the value to array(42) or null and should
be allowed.
Apropos 'expect': A programmer of a class can have some expectations
of what is stored in attributes, PHP does not enforce these
expectations (hence I put expect in quotes). And just to make it
clear: I want to keep it that way, I do not want PHP to become more
strict than it is.
So I completely agree with Stas here.
- Chris
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php