You are here: typeof in PHP? « PHP Programming Language « IT news, forums, messages
typeof in PHP?

Posted by Joshua Frank on 11/17/68 11:45

Hi All,

How can you tell if an object supports an interface? I've got a
situation where I need to tell if an object implements Iterator, but
there doesn't seem to be any operator like typeof that would let you do
this:

if($obj typeof Iterator)
...

or

if(typeof($obj) == Iterator)
...


It seems really kludgy to just try to iterate over something and wait
for it to fail, but AFAIK that's the only way to do this in PHP.

Can someone please point me in the right direction on this? Many thanks
in advance.

Cheers,
Joshua Frank
*** Posted via a free Usenet account from http://www.teranews.com ***

 

Navigation:

[Reply to this 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

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