Re: [PHP-DEV] is_a() vs. instanceof

2004-08-12 Thread Jevon Wright
OTECTED]> Sent: Thursday, August 12, 2004 9:58 PM Subject: Re: [PHP-DEV] is_a() vs. instanceof > I agree, that's the exact behavior I would like as well and what most > people would expect. > > Al > > On Wed, 2004-08-11 at 23:52 -0400, Hans Lellelid wrote: > > Ala

Re: [PHP-DEV] is_a() vs. instanceof

2004-08-12 Thread Al Baker
I agree, that's the exact behavior I would like as well and what most people would expect. Al On Wed, 2004-08-11 at 23:52 -0400, Hans Lellelid wrote: > Alan Knowles wrote: > > > I think he's referening to something like this (which is common in pear): > > > > $x = $someobj->somemethod(); > > if

Re: [PHP-DEV] is_a() vs. instanceof

2004-08-11 Thread Hans Lellelid
Alan Knowles wrote: I think he's referening to something like this (which is common in pear): $x = $someobj->somemethod(); if ($x instanceOf PEAR_Error) { ... } while that code is redundant in the case of exceptions, it is still a valid situation.. that $x may be a valid return, and PEAR_Err

Re: [PHP-DEV] is_a() vs. instanceof

2004-08-11 Thread Sean Coates
Dan Ostrowski wrote: On Tuesday 10 August 2004 7:36 pm, Hans Lellelid wrote: The class must be loaded in order to perform an instanceof check! *snip* Am I misunderstanding you? consider the following: class Foo {} $foo = unserialize('O:3:"Foo":0:{}'); echo '$foo is_a Foo? '. (is_a($foo, 'Foo')

Re: [PHP-DEV] is_a() vs. instanceof

2004-08-11 Thread Alan Knowles
I think he's referening to something like this (which is common in pear): $x = $someobj->somemethod(); if ($x instanceOf PEAR_Error) { ... } while that code is redundant in the case of exceptions, it is still a valid situation.. that $x may be a valid return, and PEAR_Error was never loaded

Re: [PHP-DEV] is_a() vs. instanceof

2004-08-11 Thread Dan Ostrowski
On Tuesday 10 August 2004 7:36 pm, Hans Lellelid wrote: > I like the new $obj instanceof ClassName way of checking class / > interface types, but this method does have one major drawback > compared to the old is_a() approach: > > The class must be loaded in order to perform an instanceof c

[PHP-DEV] is_a() vs. instanceof

2004-08-10 Thread Hans Lellelid
I like the new $obj instanceof ClassName way of checking class / interface types, but this method does have one major drawback compared to the old is_a() approach: The class must be loaded in order to perform an instanceof check! Apparently is_a() has also been deprecated, so that an E_