Re: transversing associative arrays from C

From: Date: Fri, 26 Aug 2011 04:24:13 +0000
Subject: Re: transversing associative arrays from C
References: 1 2 3 4 5 6 7  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
hi
  every api has lots of 'samples' ,that are the standard extensions in src/ext/*

   :)

Thanks
Sent from my iPhone

在 2011-8-26,11:20,Aaron Gray <[email protected]> 写道:

> Hi Stas,
>
> "Stas Malyshev" <[email protected]> wrote in message news:[email protected]...
>> Hi!
>>
>> On 8/25/11 5:52 PM, Aaron Gray wrote:
>>> Thinking about it what I really want to do is see if a key exists in an
>>> array and get its type to see if it is BOOL and that it is TRUE.
>>
>> For this, you will need to call zend_hash_find (or zend_symtable_find if there's a
>> possibility of keys like "0" that have to be treated as 0).
>
> Okay, found it, "zend_hash.h", so that should be accessable to my module :)
>
>> If you get SUCCESS, the key exists and you'll be getting zval **, then either check
>> it's type and value with Z_TYPE_PP and Z_LVAL_PP or call zend_is_true(*val) to get generic
>> truth value (like if(), etc. do).
>
> Great.
>
> That seems alot simpler.
>
> Many thanks,
>
> Aaron
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>


Thread (10 messages)

« previous php.internals (#54963) next »