> -----Original Message-----
> From: Clint Priest [mailto:cpri...@zerocue.com]
> Sent: 28 October 2012 16:03
> 
> 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? */
> 
> I mean specifically, there is no getter defined, therefore the
> result
> if isset is indeterminate

I've been holding back from the accessors discussion as I'm hovering
around -0 on the whole thing, but this one is really very simple and
obvious as far as I'm concerned: no getter, means no value, means not
set, means isset() returns FALSE. Also, the description of isset()'s
return value (at http://php.net/isset) is "Returns TRUE if var exists
and has value other than NULL, FALSE otherwise"; this would also seem
to mandate returning FALSE (since a property with no getter effectively
would not exist in a "get" context).

Cheers!

Mike

-- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Portland PD507, City Campus, Leeds Metropolitan University,
Portland Way, LEEDS,  LS1 3HE,  United Kingdom 
E: m.f...@leedsmet.ac.uk     T: +44 113 812 4730



 



To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

Reply via email to