Re: Getting object property value
| From: | Andrei Zmievski | Date: | Tue, 15 Aug 2000 15:06:14 +0000 |
| Subject: | Re: Getting object property value | ||
| References: | 1 2 3 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-28977@lists.php.net to get a copy of this message | ||
On Tue, 15 Aug 2000, Gustavo Badauy wrote:
> What I could get from the code below MyFunction receives an object as
> parameter. What I'm trying to do is, from inside a method, read/set the
> properties.
>
> For example in a function I do:
>
> object_init (return_value);
> add_property_long (return_value,"Birthday",Birthday);
> add_method(return_value,"GetUserAge",UserAge);
>
> in PHP_FUNCTION(GetUserAge), how would I get the value of Birthday?
>
> Sorry if it was explained below, but I just couldn't understand it.
zval **birthday;
zend_hash_find(HASH_OF(return_value), "GetUserAge", sizeof("GetUserAge"),
(void**)&birthday);
-Andrei
"Man, if you gotta ask you'll never know."
- Louis Armstrong, when asked "What is jazz?"