Reply to Re: typeof in PHP?

Your name:

Reply:


Posted by Richard Levasseur on 12/19/72 11:45

You may also find the following helpful:

http://us3.php.net/manual/en/ref.classobj.php (class/object functions)
http://us3.php.net/manual/en/language.oop5.reflection.php (Reflection
API)

Also note, in PHP4, classes have lower case names when you use
get_class(), even if defined with upper case letters. ie: MyClass =>
myclass.
In PHP5, it stays the same as declared.

Typo by Wayne: instanceof is available in PHP5, not PHP4.

Also be aware of differences between how objects are handled in PHP5 vs
PHP4.
PHP5 treats them more like java, they are all passed by reference.
PHP4 copies them all over the place (thus the use for $o = & new
Object() );
Search around in the manual and user comments for more specific and
detailed information.

-Richard Levasseur

Joshua Frank wrote:
> Thanks. That did the trick. Incidentally, I spent a while googling
> this without finding this info. I tried quite a few combinations of
> words like type, interface, typeof, etc... without finding these terms.
> I did try, really.
>
> Thanks again.
>
> Wayne wrote:
> > On Thu, 20 Apr 2006 12:57:48 -0400, Joshua Frank
> > <jfrank@archimetrics.remove-luncheon-meat.com> wrote:
> >
> >> 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
> >
> > You really didn't look hard enough!
> >
> > In PHP4, use the is_a() function.
> > In PHP4, use the instanceof operator.
> >
> *** Posted via a free Usenet account from http://www.teranews.com ***

[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

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