Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54960 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38225 invoked from network); 26 Aug 2011 01:03:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Aug 2011 01:03:24 -0000 Authentication-Results: pb1.pair.com header.from=smalyshev@sugarcrm.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=smalyshev@sugarcrm.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sugarcrm.com designates 207.97.245.193 as permitted sender) X-PHP-List-Original-Sender: smalyshev@sugarcrm.com X-Host-Fingerprint: 207.97.245.193 smtp193.iad.emailsrvr.com Linux 2.6 Received: from [207.97.245.193] ([207.97.245.193:50534] helo=smtp193.iad.emailsrvr.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 58/D2-22704-BD0F65E4 for ; Thu, 25 Aug 2011 21:03:24 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp59.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 38EF33F0309; Thu, 25 Aug 2011 21:03:21 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp59.relay.iad1a.emailsrvr.com (Authenticated sender: smalyshev-AT-sugarcrm.com) with ESMTPSA id AFFC93F01EE; Thu, 25 Aug 2011 21:03:20 -0400 (EDT) Message-ID: <4E56F0D6.20608@sugarcrm.com> Date: Thu, 25 Aug 2011 18:03:18 -0700 Organization: SugarCRM User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0) Gecko/20110812 Thunderbird/6.0 MIME-Version: 1.0 To: Aaron Gray CC: "internals@lists.php.net" References: <4C.43.20800.655C65E4@pb1.pair.com> <4E56E662.90804@oracle.com> <8A.82.22704.17EE65E4@pb1.pair.com> In-Reply-To: <8A.82.22704.17EE65E4@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] transversing associative arrays from C From: smalyshev@sugarcrm.com (Stas Malyshev) 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). 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). -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227