Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54964 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62580 invoked from network); 26 Aug 2011 04:48:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Aug 2011 04:48:54 -0000 X-Host-Fingerprint: 212.159.110.144 mwgray.force9.co.uk Received: from [212.159.110.144] ([212.159.110.144:12314] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8B/22-50467-6B5275E4 for ; Fri, 26 Aug 2011 00:48:54 -0400 Message-ID: <8B.22.50467.6B5275E4@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> <25.F3.22704.CB0175E4@pb1.pair.com> <7256329410255948429@unknownmsgid> In-Reply-To: <7256329410255948429@unknownmsgid> Date: Fri, 26 Aug 2011 05:48:47 +0100 Lines: 49 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; reply-type=original Content-Transfer-Encoding: 8bit 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") Thanks ! "Xinchen Hui" wrote in message news:7256329410255948429@unknownmsgid... 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 写道: > 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 > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >