Marcus Boerger wrote:
>> unset($o_Foo->bar);
>> echo $o_Foo->bar;
> ?>>
> 
>> outputs ...
>> Notice: Undefined property: foo::$bar in C:\- on line 13
> 
> At this point you found an error. Because this allows unset() to modify an
> instance in a way that it nolonger adheres to its class that means at this
> point the following is nolonger valid: $o_Foo is-a foo. And that is the
> basic design rule we chose for PHP. Please file as a bug!

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'd ask not to change this behaviour as you'll just add another (IMHO
bogus) restriction on how an object or class can be modified at runtime.
An error possibly caused by this is already handled by the E_NOTICE
message anyway.

For comparison: Having to declare static class variables is a similar
restriction which got in my way more often than it helped me.

- Chris

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

Reply via email to