Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73881 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56210 invoked from network); 5 May 2014 03:48:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 May 2014 03:48:21 -0000 Authentication-Results: pb1.pair.com smtp.mail=the.warl0ck.1989@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=the.warl0ck.1989@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.181 as permitted sender) X-PHP-List-Original-Sender: the.warl0ck.1989@gmail.com X-Host-Fingerprint: 209.85.214.181 mail-ob0-f181.google.com Received: from [209.85.214.181] ([209.85.214.181:47410] helo=mail-ob0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/22-22971-40A07635 for ; Sun, 04 May 2014 23:48:21 -0400 Received: by mail-ob0-f181.google.com with SMTP id wm4so1042545obc.40 for ; Sun, 04 May 2014 20:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wfrSNmkpRmGA9WVVp3iQ8tBRjelGytzkCOfM/rBGSEo=; b=X9IOZkqdQeTlP0ha7bH8dO+I4hDrBGIX/Sk1E241cpRCOLwuTJska5GiranOGbnTrE RfQuPDsCOj83QoSgwL1dO++jXgXS5IgtaK/zq8SPjsx82h1vam7JdAiiU+FevM1ccJIZ +kmLRVD+vEDUy4Nnc1+BPTktTv8NXJrzZzGt7RTx833lmODq67/gSsel5Ft6Mn7N8tuO m89LNWeTf91FFgT3zUO85bw9PJ5abBFi4XKH2jtNXCq10flQRZBWLMze/3feTht6jaAJ D8+mVt9Rf9P1vf2s4XXWJvZNJB3MMWvVJ3rqzn2aEhHd0je8qLZS1aEqbja6ejEINX59 FGmA== MIME-Version: 1.0 X-Received: by 10.60.159.36 with SMTP id wz4mr30994654oeb.30.1399261698420; Sun, 04 May 2014 20:48:18 -0700 (PDT) Received: by 10.76.23.66 with HTTP; Sun, 4 May 2014 20:48:18 -0700 (PDT) In-Reply-To: References: <1399216437.14925.0.camel@localhost.localdomain> Date: Mon, 5 May 2014 11:48:18 +0800 Message-ID: To: Joe Watkins Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Is it possible to get the variable name from the HashTable structure? From: the.warl0ck.1989@gmail.com (Aaron Lewis) Please ignore that, it's badly formatted, see this one instead https://gist.github.com/CaledoniaProject/2c2871b5fa36ab6a93e4#file-php-test-inner On Mon, May 5, 2014 at 11:45 AM, Aaron Lewis wrote: > Hi Watkins, > > First of all, pthreads@pthreads.org? Nice account > > I'm trying your patch, but in a different place > > In static inline zval **zend_fetch_dimension_address_inner(HashTable > *ht, const zval *dim, int dim_type, int type TSRMLS_DC), > > fetch_string_dim: > if (zend_hash_quick_find(ht, offset_key, offset_key_length+1, hval, > (void **) &retval) == FAILURE) { > ... > > fetch_string_dim: > if (zend_hash_quick_find(ht, offset_key, offset_key_length+1, hval, > (void **) &retval) == FAILURE) { > switch (type) { > case BP_VAR_R: > printf ("(R) Undefined index %s, looking up > array variable name\n", offset_key); > > HashPosition position; > zval **test = NULL; > for > (zend_hash_internal_pointer_reset_ex(EG(active_symbol_table), > &position); > > zend_hash_get_current_data_ex(EG(active_symbol_table), (void**)&test, > &position) == SUCCESS; > > zend_hash_move_forward_ex(EG(active_symbol_table), &position)) { > printf ("Comparing with: %s\n", > ((Bucket*)position)->arKey); > if (*test == ht) { > printf ("Found variable name: %s\n", > ((Bucket*)position)->arKey); > // > RETURN_STRINGL(((Bucket*)position)->arKey, > ((Bucket*)position)->nKeyLength, 1); > } > } > > .... > > > Hmm, I got no match ... am I wrong somewhere? > > > On Sun, May 4, 2014 at 11:13 PM, Joe Watkins wrote: >> On Sun, 2014-05-04 at 20:21 +0800, Aaron Lewis wrote: >>> Hi, >>> >>> So PHP uses HashTable to store variables like $_POST, >>> >>> From a HashTable structure, can I get the array name? >>> >>> -- >>> Best Regards, >>> Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ >>> Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 >>> >> >> https://gist.github.com/krakjoe/50603be7ffb1ae6e9156 >> >> Cheers >> Joe >> > > > > -- > Best Regards, > Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ > Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 -- Best Regards, Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33