Re: Querying an object's functions
| From: | Rasmus Lerdorf | Date: | Mon, 24 Sep 2001 22:54:55 +0000 |
| Subject: | Re: Querying an object's functions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-68619@lists.php.net to get a copy of this message | ||
http://www.php.net/manual/en/function.get-class-methods.php
On Mon, 24 Sep 2001, Steve Cayford wrote:
> Is there any way in PHP 4.0.6 to query an object for its member
> functions? For example I have a couple classes that have an htmlString()
> function to display themselves in some special way as html. I'd like to
> go through a list of various objects, find out if each can run
> htmlString() and if so use that, otherwise use some generic
> object-to-html function.
>
> I could just put a member variable in the object and check for that, but
> it would be more elegant to be able to check for the function directly.
>
> Thanks for any suggestions.
>
> -Steve
>
>