Re: object reflection in php?
| From: | Andrey Hristov | Date: | Mon, 18 Mar 2002 14:01:11 +0000 |
| Subject: | Re: object reflection in php? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-88925@lists.php.net to get a copy of this message | ||
get_object_vars(),
get_class_vars(),
get_class_methods()
Andrey
----- Original Message -----
From: "Filippo Veneri" <filippo.veneri@exsense.com>
To: <php-general@lists.php.net>
Sent: Monday, March 18, 2002 1:28 PM
Subject: [PHP] object reflection in php?
> Is there a way to get the name of a filed
> from a variable pointing to some object?
>
> Just to make myself understood:
>
> class obj {
> var $field;
> function obj( $value ) {
> $this->field = $value;
> }
> }
>
> $o = new obj( "field value" );
>
> How can i know, if possible, that the instance of
> obj pointed to by $o has a field named "field"?
>
> This would be useful to write an object to a database
> without knowing its structure 'a-priori'.
>
> Thanks
>
> fbv
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>