I already complained about that issue several times on IRC
and now that it's time for PHP-5.1 to come, I'll just throw
this question/rant in...
Using is_a()
throws a notice (E_STRICT IIRC) in PHP5, which
should be fine, because it was deprecated in favour of the
instanceof operator. But there's quite an ugly problem with
the instnceof operator - it needs the class to be checked
already loaded, while is_a()
didn't -- and instanceof
let the script die if there's no such class.
To replace
is_a($obj, 'ClassName')
calls one would need to write
class_exists('ClassName') && ($obj instanceof ClassName)
The point is, that I don't see the point why is_a()
has been
deprecated (and replaced) by an operator that doesn't provide
the same functionality and can even be harmful (with fatal errors).
Regards,
Mike
Will look into it.
At 11:15 PM 6/15/2005 +0200, Michael Wallner wrote:
I already complained about that issue several times on IRC
and now that it's time for PHP-5.1 to come, I'll just throw
this question/rant in...Using
is_a()
throws a notice (E_STRICT IIRC) in PHP5, which
should be fine, because it was deprecated in favour of the
instanceof operator. But there's quite an ugly problem with
the instnceof operator - it needs the class to be checked
already loaded, whileis_a()
didn't -- and instanceof
let the script die if there's no such class.To replace
is_a($obj, 'ClassName')
calls one would need to write
class_exists('ClassName') && ($obj instanceof ClassName)The point is, that I don't see the point why
is_a()
has been
deprecated (and replaced) by an operator that doesn't provide
the same functionality and can even be harmful (with fatal errors).Regards,
Mike
http://www.akbkhome.com/blog.php/View/75/removing+that+stupid+is_a
+warning..html
You're not the only one ;)
Regards
Alan
I already complained about that issue several times on IRC
and now that it's time for PHP-5.1 to come, I'll just throw
this question/rant in...Using
is_a()
throws a notice (E_STRICT IIRC) in PHP5, which
should be fine, because it was deprecated in favour of the
instanceof operator. But there's quite an ugly problem with
the instnceof operator - it needs the class to be checked
already loaded, whileis_a()
didn't -- and instanceof
let the script die if there's no such class.To replace
is_a($obj, 'ClassName')
calls one would need to write
class_exists('ClassName') && ($obj instanceof ClassName)The point is, that I don't see the point why
is_a()
has been
deprecated (and replaced) by an operator that doesn't provide
the same functionality and can even be harmful (with fatal errors).Regards,
Mike
Seems to work...
At 11:15 PM 6/15/2005 +0200, Michael Wallner wrote:
I already complained about that issue several times on IRC
and now that it's time for PHP-5.1 to come, I'll just throw
this question/rant in...Using
is_a()
throws a notice (E_STRICT IIRC) in PHP5, which
should be fine, because it was deprecated in favour of the
instanceof operator. But there's quite an ugly problem with
the instnceof operator - it needs the class to be checked
already loaded, whileis_a()
didn't -- and instanceof
let the script die if there's no such class.To replace
is_a($obj, 'ClassName')
calls one would need to write
class_exists('ClassName') && ($obj instanceof ClassName)The point is, that I don't see the point why
is_a()
has been
deprecated (and replaced) by an operator that doesn't provide
the same functionality and can even be harmful (with fatal errors).Regards,
Mike
Hi Andi Gutmans, you wrote:
Seems to work...
Sorry, what seems to work what way?
Thanks,
Michael - < mike(@)php.net