Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75733 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13019 invoked from network); 21 Jul 2014 03:12:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jul 2014 03:12:23 -0000 Authentication-Results: pb1.pair.com header.from=the.warl0ck.1989@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=the.warl0ck.1989@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.49 as permitted sender) X-PHP-List-Original-Sender: the.warl0ck.1989@gmail.com X-Host-Fingerprint: 209.85.219.49 mail-oa0-f49.google.com Received: from [209.85.219.49] ([209.85.219.49:38605] helo=mail-oa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 45/A9-48607-6158CC35 for ; Sun, 20 Jul 2014 23:12:22 -0400 Received: by mail-oa0-f49.google.com with SMTP id eb12so6409971oac.8 for ; Sun, 20 Jul 2014 20:12:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=21CsJELdu5mS3ufKBEYUQVTafUYRvyNNLhVbxRz9INY=; b=UfAllx1anshvX3RL2MwqbVxFY7S0HKyvSQqbiIi7lzXDjI05auxpW7dNDTw2gwxO26 buna2vtcxxtPnOxUuW8+o0jVQqL2JqBYIXCxTOSdsuBplXU8CeSgbEiEHoLtrvSyVqZJ y+6SPQU7D017enqVL6QsE3bs+pTiljAbGzEAHG+FJdKkeYVi4z1HcziqnKLEFBiYf9g/ 2jWVmnL35kLSyV64GkJVHGeK/npsZnl8sxFIgHnXwp0AmtCjvWlVQctYV9lJv47v/q0d TzAWxHzmC//DWoh9syCfaWS63y6Yi2JzG+GSzZTtACJb4kG3QJAeIk87KObWFM4CH2nR dszw== MIME-Version: 1.0 X-Received: by 10.60.135.2 with SMTP id po2mr32454318oeb.40.1405912339599; Sun, 20 Jul 2014 20:12:19 -0700 (PDT) Received: by 10.76.23.102 with HTTP; Sun, 20 Jul 2014 20:12:19 -0700 (PDT) Date: Mon, 21 Jul 2014 11:12:19 +0800 Message-ID: To: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: What's wrong with these hashtable iteration code? From: the.warl0ck.1989@gmail.com (Aaron Lewis) Hi, I'm trying to iterate through a hash table, But the zend_hash_get_current_key() doesn't seem to move forward: I'm getting duplicate output at the 'fprintf' part. for(zend_hash_internal_pointer_reset_ex(ht, &pos); zend_hash_has_more_elements_ex(ht, &pos) == SUCCESS; zend_hash_move_forward_ex(ht, &pos)) { if (zend_hash_get_current_key (ht, &string_key, &num_key, 0) != HASH_KEY_IS_STRING) continue; fprintf (stderr, "string key: %s\n", string_key); } Any ideas? -- Best Regards, Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33