transversing associative arrays from C

From: Date: Thu, 25 Aug 2011 21:57:07 +0000
Subject: transversing associative arrays from C
Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
Hi,

I am working on a C extension module for PHP and am wondering about an API
issue.

I can see how to add to an associative array :-

zval *aa;
MAKE_STD_ZVAL(aa);
array_init(aa);

Hi,

I am working on a C extension module for PHP and am wondering about an API
issue.

I can see how to add to an associative array :-

zval *aa;
MAKE_STD_ZVAL(aa);
array_init(aa);

add_assoc_string(aa, "test", "test value", 1);
add_assoc_string(aa, "test2", "test value2", 1);

but how do I transverse an associative array of values in a for loop simular
to using "foreach" in PHP ?

Hope this is not too OT for this list, but I could not find a better place
to ask the question.

I have looked through the API SVN sources and this seems like a possible
blind spot.

Many thanks in advance,

Aaron

but how do I transverse an associative array of values in a for loop simular
to using "foreach" in PHP ?

Hope this is not too OT for this list, but I could not find a better place
to ask the question.

I have looked through the API SVN sources and this seems like a possible
blind spot.

Many thanks in advance,

Aaron



Thread (10 messages)

« previous php.internals (#54953) next »