Re: Draft for bug-report-text addressing getclass()-problems

From: Date: Fri, 20 Feb 2004 10:30:43 +0000
Subject: Re: Draft for bug-report-text addressing getclass()-problems
References: 1 2  Groups: php.pear.qa 
Request: Send a blank email to pear-qa+get-589@lists.php.net to get a copy of this message
Stefan Neufeind wrote:
On 17 Feb 2004 at 18:02, Lukas Smith wrote:
Stefan Neufeind wrote:
On 17 Feb 2004 at 17:31, Pierre-Alain Joye wrote:
On Tue, 17 Feb 2004 17:26:37 +0100 "Stefan Neufeind" <stefan@neufeind.net> wrote:
It might be a good suggestion though, since most packages will already need >= 4.2.0 I suppose. However we need to clearly put a note there and should leave at least one solution in.
PEAR itselfs depends of PHP 4.2.0 and up.
Ouch ... punish me please :-)))
yup is_a is the way to go imho
Hmm, reading the docs more carefully I have some doubts: http://de3.php.net/manual/en/function.is-a.php Returns TRUE if the object is of this class or has this class as one of its parents Read again: "one of its parents". In most cases this might be fine, but it changes behaviour slightly. So maybe should we simply write "is_a() where applicable" and also give one of the other solutions? I hope that most maintainers will know what they are doing. And the others can probably just live fine with is_a() :-)))
Just list all of their 3 options in the bug report strtolower(get_class($foo)) == 'foo' is_a($foo, 'foo') !strcasecmp(get_class($foo), 'foo') regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

« previous php.pear.qa (#589) next »