Re: PEAR.php -> PEAR_Error - is it a "bug/misspelling" ?

From: Date: Sat, 06 Mar 2004 10:08:40 +0000
Subject: Re: PEAR.php -> PEAR_Error - is it a "bug/misspelling" ?
References: 1  Groups: php.pear.dev php.pear.general 
Request: Send a blank email to pear-dev+get-26157@lists.php.net to get a copy of this message
Let's move this discussion at least to pear-dev ... What's the difference between these two iffs? I suspect they were written exactly as mentioned in the email, so both checks would apply. Why does one check a property and the other doesn't? Stefan On 5 Mar 2004 at 16:15, Jesus M. Castagnetto wrote: > That is to make the methods work when called from an instance or > statically (PHP 4 does not have an enforced static concept, PHP 5 > does), e.g. $obj=new Bar(); $obj->foo(); vs Bar::foo(); > > Cheers. > > --- Tommy Ipsen <tipsen@imada.sdu.dk> wrote: > > Hi everybody > > > > When trying to understand the concept of error handling I stumbled > > upon the following inconsistency in PEAR.php in the class > > PEAR_Error: > > > > > > if ($mode & PEAR_ERROR_CALLBACK) { > > $this->level = E_USER_NOTICE; > > $this->callback = $options; > > } else { > > if ($options === null) { > > $options = E_USER_NOTICE; > > } > > $this->level = $options; > > $this->callback = null; > > } > > if ($this->mode & PEAR_ERROR_PRINT) { > > if (is_null($options) || is_int($options)) { > > $format = "%s"; > > } else { > > $format = $options; > > } > > printf($format, $this->getMessage()); > > } > > > > I'm thinking of these two lines: > > > > if ($mode & PEAR_ERROR_CALLBACK) { > > if ($this->mode & PEAR_ERROR_PRINT) { > > > > How come one is "$mode" and the other is "$this->mode" ? It > > shouldn't make any difference but it just seems strange to me with > > this inconsistency! > > > > Cheers, Tommy > > > > -- > > PEAR General Mailing List (http://pear.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > ===== > -- > Jesus M. Castagnetto (jcastagnetto@yahoo.com) > Research: http://metallo.scripps.edu/ > Personal: http://www.castagnetto.org/ > PEAR stuff: http://pear.php.net/user/jmcastagnetto > > __________________________________ > Do you Yahoo!? > Yahoo! Search - Find what you’re looking for faster > http://search.yahoo.com > > -- > PEAR General Mailing List (http://pear.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.pear.dev (#26157) next »