Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43983 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 45042 invoked from network); 15 May 2009 11:48:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2009 11:48:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=farleyknight@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=farleyknight@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.166 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: farleyknight@gmail.com X-Host-Fingerprint: 209.85.219.166 mail-ew0-f166.google.com Received: from [209.85.219.166] ([209.85.219.166:54566] helo=mail-ew0-f166.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/93-27038-6A65D0A4 for ; Fri, 15 May 2009 07:48:55 -0400 Received: by ewy10 with SMTP id 10so2364542ewy.23 for ; Fri, 15 May 2009 04:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=uGS+v6rNnY7Z/hI58cII6ySwiU8TcSv1AbIBaNFsFZQ=; b=QkP6B99XCXZy6MswSNyrtO8gSgZ+s5tLvuuScJ66X+tjW7PrToyg6+J2LbrAtVGhyF NHUl8hvVBFbf2jEXAKJ+zsGyH7UhS+b8Nv0SdAPJ6nxtESlAXZ9UlBKzDrv33MMrgmLM VC+9bb491VifyICwFu6mQuAtPLFunhEXPesFE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=EJK0vu6I0JjfcTq9TLx8IypPEea8fCTk7/UFQ6nGlRishbBsV4QtJlbiBVltR1ISIE fhoaCOaHRyKCeDcxiTaaeXjY6RdeP3L2Jae6L4Gyq057GIj7DH4SCziFAd2lemUSVDjp IqktPQsCX8dK1kd4hkNEjFX4u6zovR1KUQveQ= MIME-Version: 1.0 Received: by 10.210.126.18 with SMTP id y18mr836944ebc.12.1242388131637; Fri, 15 May 2009 04:48:51 -0700 (PDT) In-Reply-To: <4A0D21B4.3000804@daylessday.org> References: <4A0D21B4.3000804@daylessday.org> Date: Fri, 15 May 2009 07:48:31 -0400 Message-ID: To: Antony Dovgal Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Segfault while looping through hash table From: farleyknight@gmail.com (Farley Knight) On Fri, May 15, 2009 at 4:03 AM, Antony Dovgal wrote: > On 15.05.2009 07:31, Farley Knight wrote: >> =A0 while (zend_hash_get_current_data(Z_ARRVAL(zhash), (void**)&value) >> =3D=3D SUCCESS) { >> =A0 =A0 current++; >> =A0 =A0 printf("Currently on entry %d\n", current); >> =A0 =A0 if (zend_hash_move_forward(Z_ARRVAL(zhash)) =3D=3D SUCCESS) >> =A0 =A0 =A0 printf("Done moving hash forward. Result was successful\n"); >> =A0 =A0 else >> =A0 =A0 =A0 printf("Done moving hash forward. Result was a failure\n"); >> =A0 } > > What's the point of this if() ? > You continue reading the values even if move_forward() fails (i.e. the en= d is reached). I threw that in for debugging purposes.. So it's completely useless otherwi= se :) > > -- > Wbr, > Antony Dovgal > - Farley