Date: 08/15/00
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6165 Updated: Session ID appears twice in the URL when using SID"
- Previous message: anil <email protected>: "[PHP-DEV] PHP 4.0 Bug #6168: main.c compile failure"
- In reply to: Andrei Zmievski: "Re: FW: [PHP-DEV] Getting object property value"
- Next in thread: Andrei Zmievski: "Re: [PHP-DEV] Getting object property value"
- Reply: Andrei Zmievski: "Re: [PHP-DEV] Getting object property value"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
Thanks
Is it possible to, inside the extension, use "this"? For
----- Original Message -----
From: "Andrei Zmievski" <andrei <email protected>>
To: "Mathieu Kooiman" <caps <email protected>>
Cc: "PHP Development" <php-dev <email protected>>
Sent: Tuesday, August 15, 2000 11:19 AM
Subject: Re: FW: [PHP-DEV] Getting object property value
> On Tue, 15 Aug 2000, Mathieu Kooiman wrote:
> > /* Writing this from my memory, am not sure about some stuff.. but It
should
> > get you
> > started.. */
> >
> > PHP_FUNCTION (MyFunction) {
> > pval **MyObject;
> > HashTable *Properties;
> >
> > if ( zend_get_parameters_ex(1, &MyObject) == FAILURE)
> > WRONG_PARAM_COUNT;
> >
> > Properties = (*MyObject)->obj.ce->default_properties;
> > // perhaps its 'properties' look at struct _zend_class_entry { }
> > // This is a normal hashtable, use zend_hash_*() on it.
> > }
>
> Or you can simply do:
>
> Properties = HASH_OF(*MyObject);
>
> -Andrei
>
> Linux is like living in a teepee.
> No Windows, no Gates, Apache in house.
> - Usenet signature
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
> For additional commands, e-mail: php-dev-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Bug Database: "[PHP-DEV] PHP 4.0 Bug #6165 Updated: Session ID appears twice in the URL when using SID"
- Previous message: anil <email protected>: "[PHP-DEV] PHP 4.0 Bug #6168: main.c compile failure"
- In reply to: Andrei Zmievski: "Re: FW: [PHP-DEV] Getting object property value"
- Next in thread: Andrei Zmievski: "Re: [PHP-DEV] Getting object property value"
- Reply: Andrei Zmievski: "Re: [PHP-DEV] Getting object property value"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

