Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:61526 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22663 invoked from network); 19 Jul 2012 22:20:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jul 2012 22:20:53 -0000 Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.160.170 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.160.170 mail-gh0-f170.google.com Received: from [209.85.160.170] ([209.85.160.170:47005] helo=mail-gh0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C7/9D-18983-34888005 for ; Thu, 19 Jul 2012 18:20:52 -0400 Received: by ghbg2 with SMTP id g2so3876153ghb.29 for ; Thu, 19 Jul 2012 15:20:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:x-originating-ip:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=6kmRjNhTAc3wrKPRfz99Ij3LCTiPVdMYNC36Cuv42Ec=; b=FFjHed8WcOTIFtDadbr9HNRLkUXkRTNwr8D5u7v8xh+05w4GqT8doqrKfbrEGA0+hM vyHpHuTDco9Zeq8u9xEZgHUVDi1eKsUh/GjV+jKAfu4C+xD7ePLc8I9yS/2VyeMw6WIo g+zcIu0pgJr+5uB6fT/uEWShOaf4WNxLMrrspH3cji19Fg7fmWNPybYl6c4F+fsQLXEe fJXbXk83QjHWQeoS+7GOxV4poy3fs0JyUZSx+xTqmBAFm88tVBCdD1D3f+Jfy/jpXs13 wYVA1i7872EcgGPf/6SWG6/mfmsVSUQCq7+esk1UP48TWPc4zcmDe7dJ3lRGp0hzu9Jq 2+NQ== MIME-Version: 1.0 Received: by 10.50.94.228 with SMTP id df4mr2807196igb.34.1342736449199; Thu, 19 Jul 2012 15:20:49 -0700 (PDT) Sender: php@golemon.com Received: by 10.64.24.242 with HTTP; Thu, 19 Jul 2012 15:20:49 -0700 (PDT) X-Originating-IP: [2620:0:1cfe:28:8cb3:438e:1db2:b161] In-Reply-To: References: Date: Thu, 19 Jul 2012 15:20:49 -0700 X-Google-Sender-Auth: zbKOP-cgSomjPm65bnDzzt9cPu0 Message-ID: To: Nikita Popov Cc: Gustavo Lopes , "internals@lists.php.net" Content-Type: multipart/alternative; boundary=e89a8f23545314df1604c5363185 X-Gm-Message-State: ALoCoQk/2Vhlwskz5j5cSaiF93albLw4whEb0FuySAPSP6fj6HOfjSDTkQg5mvtSRhav3JYLvFE1 Subject: Re: [PHP-DEV] zend_parse_parameters() improvements From: pollita@php.net (Sara Golemon) --e89a8f23545314df1604c5363185 Content-Type: text/plain; charset=ISO-8859-1 Okay, well... the main pieces of feedback I'd give on it then is to not change the behavior of the '!' modifier. That's bad BC. Rather, introduce a new modifier for checking if a parameter was passed. Secondly, make these two separate patches as the new modifier is a separate feature from the single-arg parameter parsing. FWIW, there are a few examples of this being handled by defining the default value of the parameter to something non-sensical (such as a length of -1), then doing zpp with "|l!" would leave the default -1 alone when NULL is passed, and you can treat as "not passed". Granted this is a bit of a hack and won't work for all situations. Your approach is more comprehensive, just saying that for many cases it's not strictly needed. -Sara On Thu, Jul 19, 2012 at 2:33 PM, Nikita Popov wrote: > On Thu, Jul 19, 2012 at 11:23 PM, Sara Golemon wrote: > > Then I'm not sure what problem you're trying to solve either. :/ > > This solves two problems: > > a) Integer parameters cannot currently be skipped using NULL. This > issue comes up every now and then. E.g. see > https://github.com/php/php-src/pull/133. > > b) If you need more complex argument handling you currently have to > fetch the value as z and then use some convert_to_* function. But > those convert_to_* functions behave differently than zpp. So a > function for parsing a single parameter is exposed too. > > Nikita > --e89a8f23545314df1604c5363185--