Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87719 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2398 invoked from network); 11 Aug 2015 20:27:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Aug 2015 20:27:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.182 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.213.182 mail-ig0-f182.google.com Received: from [209.85.213.182] ([209.85.213.182:34198] helo=mail-ig0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/36-00789-7CA5AC55 for ; Tue, 11 Aug 2015 16:27:53 -0400 Received: by igui7 with SMTP id i7so48466059igu.1 for ; Tue, 11 Aug 2015 13:27:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=B9sQAKs/oeQODcWwOnBktPHGr9GBywuRl9RVhMRIScs=; b=VWoC4cNkfJ0fkSBSGgrjiywNs9l9wb34ix/aSwjtPk0tX30fFJ8opxua9IXr7ZDXiC u2kg2ZwYU201/ldT3ntBsuijr72CcaShrMY0ZjROWyVB51VgrI74lTM9mojxeXp8+DZz YmUaL56Y17FaguDAawf3o1AMIQU6B15eUXKgX1jogunS91ffGyfYiRlmEKflFvThMsSV 7BvkXqhwxpxgRf5aRG2hDs1XbtjLdw6pZlJklvta4JnL4g1Qm1IOqbCYMKH9Mg39KrhI SnWdTqviaKKHUfARxActSDBPHLZW34OQHr4u4iyjzSUbPY2TzP5Zdf7a1/3C+yzuIOsB HXOw== X-Gm-Message-State: ALoCoQl/1N3A0YCQSJXuVapzSI2i1N3lipbwrxWAkQihhHEOMPD/Pcp0AbVgnA/gVMMORRqIuiFFIOt4qv/7ygJlTElTanL4EF9/kknDt2ql7ghEuLdqNrjdgpc2sT8FIzOsITy39m9eYO2QZDALbD5wRbtrChnAYQFPrbf3ZpwO0a4d64ulHHI= MIME-Version: 1.0 X-Received: by 10.50.61.195 with SMTP id s3mr20025077igr.62.1439324868674; Tue, 11 Aug 2015 13:27:48 -0700 (PDT) Received: by 10.50.35.101 with HTTP; Tue, 11 Aug 2015 13:27:48 -0700 (PDT) In-Reply-To: <04E6618E3189404FB15D042E588A90FC@pc1> References: <8BE12FDCDC5C457282790368866BD61E@pc1> <04E6618E3189404FB15D042E588A90FC@pc1> Date: Tue, 11 Aug 2015 23:27:48 +0300 Message-ID: To: Matt Wilmas Cc: PHP Internals Content-Type: multipart/alternative; boundary=047d7bdc05f283abf9051d0eef1a Subject: Re: [PHP-DEV] Parameter parsing for zval type? From: dmitry@zend.com (Dmitry Stogov) --047d7bdc05f283abf9051d0eef1a Content-Type: text/plain; charset=UTF-8 On Tue, Aug 11, 2015 at 11:10 PM, Matt Wilmas wrote: > Hi Dmitry, > > > ----- Original Message ----- > From: "Dmitry Stogov" > Sent: Tuesday, August 11, 2015 > > Hi Matt, >> >> >> On Tue, Aug 11, 2015 at 9:00 PM, Matt Wilmas >> wrote: >> >> Hi again, >>> >>> ----- Original Message ----- >>> From: "Matt Wilmas" >>> Sent: Tuesday, August 11, 2015 >>> >>> Hi Dmitry, all, >>> >>>> >>>> Help me understand this. :-) It's been more puzzling to me recently >>>> since just coming to the part of optimizing traditional ZPP (sharing >>>> part >>>> with FAST_ZPP...). >>>> >>>> With the FAST_ZPP inline macros, why is there a Z_PARAM_ZVAL and >>>> Z_PARAM_ZVAL_DEREF? It seems the zpp 'z' specifier is always like >>>> ZVAL_DEREF, right? So Z_PARAM_ZVAL has no equivalent in traditional >>>> zpp. >>>> At the very least, this would seem to suggest a difference in >>>> behavior/functionality. But I haven't found any (or bug reports, if >>>> tests >>>> didn't cover something). >>>> >>>> >>> Oops! No, plain zpp 'z' does not have ZVAL_DEREF() applied, of course. >>> But it's also using zend_parse_arg_zval_DEREF(), which is wrong... (in >>> the >>> case of "z!" with reference to IS_NULL?). >>> >> >> >> Sorry. I don't understand you without context. If you think something is >> wrong in current implementation - please, demonstrate it with test cases, >> examples or code references. If you talk about your code, then show it. >> > > Sorry, thought I gave enough context and code references! I can't > demonstrate with a test case, which is why I'm asking about it. :-) > > No, not my code changes (you'll have plenty of code to see soon). I'm > fine replicating the current logic exactly, as I have, but the logic of > these couple parts doesn't make sense, to me. Let me try to simplify with > couple examples... > > Look at e.g. is_numeric() or strpos() (needle). Plain zval param parsing, > so NO ZVAL_DEREF() occurs (FAST_ZPP or traditional). These 2 example > functions don't handle IS_REFERENCE type, so they would break. > > Or is there no way for them (or any function?) to get a IS_REFERENCE? > Then *why* is there ZVAL_DEREF() in param parsing functions? We could > remove it! > We probably may remove ZVAL_DEREF() for functions arguments passed by value, but we don't know if argument was passed by value or by reference in ZPP functions. Actually, in FAST_ZPP for scalars we may probably assume passing by value and remove ZVAL_DEREF(), but I'm not sure if this is 100% safe. Thanks. Dmitry. > > Which is it...? > > Thanks. Dmitry. >> > > Thanks, > Matt > --047d7bdc05f283abf9051d0eef1a--