Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54962 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48219 invoked from network); 26 Aug 2011 03:19:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Aug 2011 03:19:25 -0000 X-Host-Fingerprint: 212.159.110.144 mwgray.force9.co.uk Received: from [212.159.110.144] ([212.159.110.144:28987] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 25/F3-22704-CB0175E4 for ; Thu, 25 Aug 2011 23:19:25 -0400 Message-ID: <25.F3.22704.CB0175E4@pb1.pair.com> To: internals@lists.php.net References: <4C.43.20800.655C65E4@pb1.pair.com> <4E56E662.90804@oracle.com> <8A.82.22704.17EE65E4@pb1.pair.com> <4E56F0D6.20608@sugarcrm.com> In-Reply-To: <4E56F0D6.20608@sugarcrm.com> Date: Fri, 26 Aug 2011 04:19:17 +0100 Lines: 27 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6002.18197 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18463 X-Posted-By: 212.159.110.144 Subject: Re: [PHP-DEV] transversing associative arrays from C From: ang.usenet@gmail.com ("Aaron Gray") Hi Stas, "Stas Malyshev" wrote in message news:4E56F0D6.20608@sugarcrm.com... > 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