(Fwd) PEAR.php -> PEAR_Error - is it a "bug/misspelling
| From: | Stefan Neufeind | Date: | Fri, 05 Mar 2004 23:48:24 +0000 |
| Subject: | (Fwd) PEAR.php -> PEAR_Error - is it a "bug/misspelling | ||
| Groups: | php.pear.qa | ||
| Request: | Send a blank email to pear-qa+get-848@lists.php.net to get a copy of this message | ||
In my eyes this should really be a mis-spelling. Or does anybody know
/ think differently?
And if it is a bug could somebody (Pierre) please correct it also in
the packages for the php-snapshots etc.?
Thank you,
Stefan
------- Forwarded message follows -------
To: pear-general@lists.php.net
Date sent: Fri, 05 Mar 2004 21:43:20 +0100
From: Tommy Ipsen <tipsen@imada.sdu.dk>
Subject: [PEAR] PEAR.php -> PEAR_Error - is it a "bug/misspelling" ?
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
------- End of forwarded message -------