Hi!
> So... to be explicit here, you think in this situation:
>
> class a {
> public $b {
> set($x) { $this->b = $x; }
> }
> }
>
> $o = new a();
>
> if(!isset($o->b)) {
> /* delete files */
> }
> echo (int)isset($o->b); /* This should return false and not emit any
> sort of warning/notice? */
isset should return false, since $b is not set value. It should not
produce any warning. Of course (int) would produce 0 then ;)
> I mean specifically, there is no getter defined, therefore the result
> if isset is indeterminate and while I can see it not causing execution
No, the result is determinate - it's false. That's the point of isset()
in PHP and that's how it is used in existing code.
> to stop I don't see it being a good idea to not warn the developer that
> what they've attempted is not correct. Without a getter, isset() is
> not a legal call (since the value cannot be retrieved).
isset() should always be legal. This is the way to check if $o->b is legal.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php