Reply to Re: is_a() against instanceof

Your name:

Reply:


Posted by Eli on 03/16/05 02:44

Jason Barnett wrote:
> Eli wrote:
> ...
>
>>- is_a($cls,"ClassName") *doesn't require* from ClassName to be
>>declared, and return false when ClassName is not declared.
>
> ...
>
> Try is_subclass_of()
>
> http://php.net/manual/en/function.is-subclass-of.php
>
is_subclass_of() is not exactly like is_a(), in that it will return
false if the object is exactly from the class.

$cls=new ClassName();
var_dump(is_subclass_of($cls,"ClassName")); //dumps: FALSE!
var_dump(is_a($cls,"ClassName")); //dumps: TRUE!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация