Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54963 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 60447 invoked from network); 26 Aug 2011 04:24:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Aug 2011 04:24:34 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.170 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.220.170 mail-vx0-f170.google.com Received: from [209.85.220.170] ([209.85.220.170:52224] helo=mail-vx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E0/D1-50467-100275E4 for ; Fri, 26 Aug 2011 00:24:33 -0400 Received: by vxh24 with SMTP id 24so2489744vxh.29 for ; Thu, 25 Aug 2011 21:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=references:from:in-reply-to:mime-version:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=VzmaSfvreqG0QInurgroMlbw7vgi89gSa43Zpw0HPCk=; b=umN6uqj3G7eLUo8g368vw2hXw41LpyfVFvEMOHCbcF0tpoNJx3FIVH7ywRPKwh+qOp 55xKA94yYBvd+32WN+QHdSCgr4LDevkIZKRpNt0kxknW103tq9AZUJ1YmbGyBHkMVp+Q bi8n0P/j8x1tv6bAfDJ+ehGryj8S8B7blGJBg= Received: by 10.220.179.75 with SMTP id bp11mr97164vcb.192.1314332670412; Thu, 25 Aug 2011 21:24:30 -0700 (PDT) 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> In-Reply-To: <25.F3.22704.CB0175E4@pb1.pair.com> Mime-Version: 1.0 (iPhone Mail 8H7) Date: Fri, 26 Aug 2011 12:24:13 +0800 Message-ID: <7256329410255948429@unknownmsgid> To: Aaron Gray Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] transversing associative arrays from C From: laruence@gmail.com (Xinchen Hui) hi every api has lots of 'samples' ,that are the standard extensions in src/= ext/* :) Thanks Sent from my iPhone =E5=9C=A8 2011-8-26=EF=BC=8C11:20=EF=BC=8CAaron Gray = =E5=86=99=E9=81=93=EF=BC=9A > Hi Stas, > > "Stas Malyshev" wrote in message news:4E56F0D6.2= 0608@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 e= ither check it's type and value with Z_TYPE_PP and Z_LVAL_PP or call zend_i= s_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 >