Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:73882 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63174 invoked from network); 5 May 2014 05:22:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 May 2014 05:22:33 -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.214.178 as permitted sender) X-PHP-List-Original-Sender: the.warl0ck.1989@gmail.com X-Host-Fingerprint: 209.85.214.178 mail-ob0-f178.google.com Received: from [209.85.214.178] ([209.85.214.178:36776] helo=mail-ob0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 06/92-22971-81027635 for ; Mon, 05 May 2014 01:22:33 -0400 Received: by mail-ob0-f178.google.com with SMTP id va2so4717234obc.9 for ; Sun, 04 May 2014 22:22:29 -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:cc:content-type; bh=le5nHs4ZjyngtwAxC54O1lUmAlEfcFldG3XfsKxa1F4=; b=cIOPh5vF2QvQTv59OljPT06hGiJaD1iP+q+SIgCu22jm0f+ITTU8/rYCVMAFbZIzvE HTkNXpvL55F9MOkVnay6xWjop4aeJtc/ZDf6uvJTz/nX5aMe5fejcGu7vpfs1L9wRhPS A4PLwf4UO1llSfcKThx9TbeEqQ7BXLS8ayNEJdUbXUQh9ibCP8JDSMjYuXja/o/7et3u BwezWCR3tTKoITsUdjmBf2CDtfsbW+hYGZ0Xi5KdpWZnbVZk9BPJa3MsxqmOfWrjx0T7 rtNhIqQ4tf0QsyC7Zowi/ubzWOnynyXU0As3ReV9SaVXmSrYegBuwERVWKJQc2pJlYCe Fvug== MIME-Version: 1.0 X-Received: by 10.60.133.107 with SMTP id pb11mr1330747oeb.48.1399267349763; Sun, 04 May 2014 22:22:29 -0700 (PDT) Received: by 10.76.23.66 with HTTP; Sun, 4 May 2014 22:22:29 -0700 (PDT) Date: Mon, 5 May 2014 13:22:29 +0800 Message-ID: To: Joe Watkins Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: [SOLVED] Re: [PHP-DEV] Is it possible to get the variable name from the HashTable structure? From: the.warl0ck.1989@gmail.com (Aaron Lewis) Never mind, just solved the problem. Clearly I should be comparing the ht with Z_ARRVAL instead ;-P On Mon, May 5, 2014 at 11:48 AM, Aaron Lewis wrote: > 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 -- Best Regards, Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33