Re: [PHP-DEV] associative arrays

2001-08-13 Thread Andrei Zmievski
On Mon, 13 Aug 2001, Rasmus Lerdorf wrote: > Ah, ok. It's not much harder: > > pval *tmp_arr; > > array_init(return_value); > MAKE_STD_ZVAL(tmp_arr); > array_init(tmp_arr); > add_assoc_string(tmp_arr, "string index", "foo", 1); > zend_hash_index_update(Z_ARRVAL_P(return_value), 5, &

Re: [PHP-DEV] associative arrays

2001-08-13 Thread Zeev Suraski
At 12:47 13-08-01, Markus Fischer wrote: >I was just kidding, really. You sure have fooled me ;) Zeev -- PHP Development Mailing List To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail:

Re: [PHP-DEV] associative arrays

2001-08-13 Thread Markus Fischer
I was just kidding, really. I'm using the docs there all day long .. But his neested example was just nice. - Markus On Mon, Aug 13, 2001 at 12:38:18PM +0300, Zeev Suraski wrote : > Actually, this is quite well documented, if you actually try to look the > documentation up... > > http://www.

Re: [PHP-DEV] associative arrays

2001-08-13 Thread Zeev Suraski
Actually, this is quite well documented, if you actually try to look the documentation up... http://www.zend.com/apidoc/x1243.php Zeev At 12:24 13-08-01, Markus Fischer wrote: >go Rasmus go! :-) > >Some more examples and we seriously can extend zend.com/apidoc . > >Such examples are of great v

Re: [PHP-DEV] associative arrays

2001-08-13 Thread Thomas Wentzel
That simple, huh? What can I say - You are the man! Thanx Rasmus Lerdorf wrote: > > Ah, ok. It's not much harder: > > pval *tmp_arr; > > array_init(return_value); > MAKE_STD_ZVAL(tmp_arr); > array_init(tmp_arr); > add_assoc_string(tmp_arr, "string index", "foo", 1); > zend_hash_

Re: [PHP-DEV] associative arrays

2001-08-13 Thread Markus Fischer
go Rasmus go! :-) Some more examples and we seriously can extend zend.com/apidoc . Such examples are of great value to anyone who is new to writing php extension. - Markus On Mon, Aug 13, 2001 at 02:14:01AM -0700, Rasmus Lerdorf wrote : > Ah, ok. It's not much harder: > > pval *tmp_arr; >

Re: [PHP-DEV] associative arrays

2001-08-13 Thread Rasmus Lerdorf
Ah, ok. It's not much harder: pval *tmp_arr; array_init(return_value); MAKE_STD_ZVAL(tmp_arr); array_init(tmp_arr); add_assoc_string(tmp_arr, "string index", "foo", 1); zend_hash_index_update(Z_ARRVAL_P(return_value), 5, &tmp_arr, sizeof(tmp_arr), NULL); This will create $whatever

Re: [PHP-DEV] associative arrays

2001-08-13 Thread Thomas Wentzel
Uhhh sorry! What I should have said is that... The associative array I wish to return is to be an array element of an associative array ;) Meaning... I need the functionality of add_assoc_array but since this function doesn't exist - I have to manipulate with the zend_hash_xxx in order to ge

Re: [PHP-DEV] associative arrays

2001-08-13 Thread Rasmus Lerdorf
> add_assoc_double(return_value, "another one", your_long_var); uh, confused double/long here. Should have said: your_double_var but you get the idea. -Rasmus -- PHP Development Mailing List To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: [PHP-DEV] associative arrays

2001-08-13 Thread Rasmus Lerdorf
> I was wondering if someone would be so nice as to post a code > snippet that returns an associative array... I'm writing an > extension and am only able to return an ordinary array... > Alternatively I would be very interested if someone could > point me to some documentation on the zend_hash_xx

[PHP-DEV] associative arrays

2001-08-13 Thread Thomas Wentzel
Hi! I was wondering if someone would be so nice as to post a code snippet that returns an associative array... I'm writing an extension and am only able to return an ordinary array... Alternatively I would be very interested if someone could point me to some documentation on the zend_hash_xxx fun