Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68652 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 31770 invoked from network); 28 Aug 2013 21:01:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Aug 2013 21:01:36 -0000 Authentication-Results: pb1.pair.com header.from=php@requinix.net; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php@requinix.net; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain requinix.net designates 209.85.192.179 as permitted sender) X-PHP-List-Original-Sender: php@requinix.net X-Host-Fingerprint: 209.85.192.179 mail-pd0-f179.google.com Received: from [209.85.192.179] ([209.85.192.179:41960] helo=mail-pd0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/C6-33204-E256E125 for ; Wed, 28 Aug 2013 17:01:35 -0400 Received: by mail-pd0-f179.google.com with SMTP id v10so6759727pde.38 for ; Wed, 28 Aug 2013 14:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=requinix.net; s=googleapps; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=rayAQ44WLfkWTqxWmW3jOHxdNKA7L4ywiv9JhIv/Ams=; b=YSJG6JiJv5UYAGl64L0wHRs7oMRhHhuTlIQB6hXq/WEmIoTb8jUTQpcBlgjUI/H3wr Qy6N6e/wfLwGY4vYjE9plYIdJJdPh4BtY9rB7t1pf2I3UpLgUVZprTJtnks2a/HMjHqu YnCOGAhGzshkXOI3P630A1umcLiObdXTX6dUs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=rayAQ44WLfkWTqxWmW3jOHxdNKA7L4ywiv9JhIv/Ams=; b=oEoHMiWWr4LlEKbOGB7e/3HLcKvNBHm970TiNh0p66qb5v0FqeSjFHTNht5ComqtS2 z0TbcewCud+4WWzv6+4H8zdoKdauJRRy3XyAWZE951mwunMw86YrzK8LfDfJ8s8r9Fqh /ZDqJ+tGtjp1FsxnPlZIpFekoD/H3P2na9z18rvRmGQ4k5/7W/2mT1M8T07FzpZgQi1j XtN41s8/Hu0lW0c/MqNXCkhQguvkiBSNvlUUwI4jQkis7hHdzohenFT5hRquxldJPGZz ioX2ABYi4o6kPTpNLUwYvTlHo9SdJKbIXeVw1/w9x7KkHSeVgz7vtpS8b8X3Od6QM5Um GCjw== X-Gm-Message-State: ALoCoQmqcWRWiF5GKQeOvORpXRNo3ondhkAiUAE5Ux9ea9PQoPp+66WQe7Z4dl1gsm+YkvglJBO7 MIME-Version: 1.0 X-Received: by 10.68.28.1 with SMTP id x1mr29209406pbg.113.1377723691922; Wed, 28 Aug 2013 14:01:31 -0700 (PDT) Received: by 10.70.135.8 with HTTP; Wed, 28 Aug 2013 14:01:31 -0700 (PDT) X-Originating-IP: [184.77.238.195] In-Reply-To: References: Date: Wed, 28 Aug 2013 14:01:31 -0700 Message-ID: To: Nikita Popov Cc: Matthew Leverton , PHP internals Content-Type: multipart/alternative; boundary=bcaec520eab1418fc404e5084b02 Subject: Re: [PHP-DEV] [RFC] Syntax for variadic functions From: php@requinix.net (Damian Wadley) --bcaec520eab1418fc404e5084b02 Content-Type: text/plain; charset=ISO-8859-1 How about having the ellipsis _after_ the variable? That then coincides with phpDocumentor's recommended syntax of "$c,..." and it keeps any typehint or & with the variable name ("array &$arr..." versus "array &...$arr") and, honestly, I think that reads more easily. On Wed, Aug 28, 2013 at 1:15 PM, Nikita Popov wrote: > On Wed, Aug 28, 2013 at 9:27 PM, Matthew Leverton >wrote: > > > Would any functions get deprecated as a result of this? e.g., > > func_get_args() > > > > Nope, func_get_args() etc stay. This is now mentioned in > https://wiki.php.net/rfc/variadics#userland. > > > > I assume it's a syntax error to do function fn(...$foo, $bar) or > > function fn(...$foo, ...$bar) > > > > Correct. This is now mentioned in > https://wiki.php.net/rfc/variadics#syntactic_restrictions. > > > > I assume that function fn($a, $b = null, ...$c) is possible, and the > > only way to populate $c is to call fn with three or more parameters. > > > > That's also correct :) > > Nikita > --bcaec520eab1418fc404e5084b02--