Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60141 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 56030 invoked from network); 18 Apr 2012 00:08:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Apr 2012 00:08:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 209.85.217.170 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@googlemail.com X-Host-Fingerprint: 209.85.217.170 mail-lb0-f170.google.com Received: from [209.85.217.170] ([209.85.217.170:61072] helo=mail-lb0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B4/AE-21594-4E50E8F4 for ; Tue, 17 Apr 2012 20:08:05 -0400 Received: by lbbgh12 with SMTP id gh12so43284lbb.29 for ; Tue, 17 Apr 2012 17:08:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/42JWZtejoQx0OX5QqlSTm0rLAio2Vewz7I+37tl2EE=; b=BiWpw0coVnXbcHQr+RqUEzIwsLeyCGGy1ckCYQbasQU0F6UTY/e6ZU6PhDARx6gj8O tVNcUC1EpT7uXTIczkGgvU389cjjXuyU4zWeHkpHYf2I/5St4AoU4AqZG5Bj53zIOuqN w5JC+wNwQpkzAfXkX42pvjj7lpcPmx8gxrl8wej7A9/aUmCi5EX+HbHlHI/wmQUgaC42 GxUtJCs9g1iIO3o9wMFGemKojrGVkhL8dUGO1ccl0E0JdI3LbYXqb8XF5W5eQg1rl+82 v6DEXE8WGenTcumOq+WMCRtaGI1BqoPl0kVv+i7IbE4reuKOvBYjRsdDlIXYepPCosB7 KkWA== MIME-Version: 1.0 Received: by 10.152.112.161 with SMTP id ir1mr187040lab.13.1334707681173; Tue, 17 Apr 2012 17:08:01 -0700 (PDT) Received: by 10.152.127.68 with HTTP; Tue, 17 Apr 2012 17:08:01 -0700 (PDT) In-Reply-To: References: <4F8DF4B1.2040307@sugarcrm.com> <0CBF8A52-E369-4F31-9415-43126FA03904@welsh.co.nz> <4F8E0347.9080609@sugarcrm.com> Date: Wed, 18 Apr 2012 02:08:01 +0200 Message-ID: To: Etienne Kneuss Cc: Stas Malyshev , PHP Internals Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] [RFC] skipping optional parameters From: nikita.ppv@googlemail.com (Nikita Popov) On Wed, Apr 18, 2012 at 2:03 AM, Etienne Kneuss wrote: > Hi, > > > On Wed, Apr 18, 2012 at 01:56, Stas Malyshev wrote: >> Hi! >> >>> Since func_num_args() won't be able to be used to see if an argument is set, could a func_isset_arg() be added? So something like: >>> if(func_num_args() > 2) $value = func_get_arg(2); >>> would become: >>> if(func_isset_arg(2)) $value = func_get_arg(2); >> >> I think it's easier to just do func_get_args() and check for isset there >> :) You usually don't have too many args so getting all of them is not a >> big problem. >> > > +1 > > BTW: the diffs show a lot of WS changes that you should probably fix. On a side note, one can pass ?w=1 to the github diff, so it will show up without WS changes: https://github.com/smalyshev/php-src/commit/0f78493d3e96a627caa8258ee9e618301b6b3511?w=1 Makes is a bit easier to spot the relevant parts. I'm also +1 on the proposal :) Nikita