Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100913 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52327 invoked from network); 22 Oct 2017 06:25:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Oct 2017 06:25:58 -0000 Authentication-Results: pb1.pair.com header.from=kalle.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kalle.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.194 as permitted sender) X-PHP-List-Original-Sender: kalle.php@gmail.com X-Host-Fingerprint: 209.85.223.194 mail-io0-f194.google.com Received: from [209.85.223.194] ([209.85.223.194:52095] helo=mail-io0-f194.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/25-58908-4F93CE95 for ; Sun, 22 Oct 2017 02:25:58 -0400 Received: by mail-io0-f194.google.com with SMTP id b186so17077892iof.8 for ; Sat, 21 Oct 2017 23:25:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=/0Q4Tr6NHzM2PMsPpzA5/+yZY5uil3quSmGDSI2nWUg=; b=ryUYKSKxeP/FcYZHvPfHEShjOPSNd1N/U/LvR0NcxjfvynkYEsuS7SqyfVj02tZOLK JEHBQrJQVzWixhQoCMJRi1DgeRzgRSjllDcyeRb7KVQevD44hfMrDTHRiUfVcuVycped gj46e29E2tVi79uMSnNd+bT+rEKMh/so2/bZlkGtbe8KpDs7e8DNvEFhdd5Gwdvtgnsr sqreugrMoSAwZJ7/edOslcYxEFXZv+HDwptTwblWysRKokxlWQeg5lPJZBGJ4FqA8IH8 t46iKUE6ebWgEAtjxkFJkT5aV6DRC+9fAKdrdwhT07yp7i4pJfl3Oxt2wn0SSh90khz4 veeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=/0Q4Tr6NHzM2PMsPpzA5/+yZY5uil3quSmGDSI2nWUg=; b=VxhaIa5laPHZ7fSM5X1bS5QCUYbjcx4sPt1IhfeNxipHZ/31aFhGMvKLjH+M6fNOn3 PcETmG9yxu/yIePh37rl+Uq9FxBZxm+gRxRCm4S7qqL+1sk7ertW24kDfPnHyj2rCiy8 6jfrGh+jxRtf0fhRTxmhz8bmTcQ5ot/aRAi2Z1q42Camrd/8S8LKwhYiKHUtK1il6Rd8 10ZvjNmk2rClRx0Yw2davwlREeo1FHNKuts3tjT3BYS/JwPy3d6uF+V+hGpQjluTTKi4 B31zzg2229tfbSivnKkZTqSlloQBkJFWUIX6eWSBL2dNTFluMryJ+UMTu1vy/FvEeHtn MkGA== X-Gm-Message-State: AMCzsaURKleozz4p4sdGNn94xplpDazyBRaxDp1VGK4No7ieqAazqZC8 NAcJIWbiSLvoz9fQhn04/mrYZ1gL+frnR3UCMkM= X-Google-Smtp-Source: ABhQp+S/dR4sFMtQv99ZkK8t/Rkj4+gpqa/0nSVVtUdSPn/PwR80T9DQQwccSWLQAMzKNxZaa2wlreGtws11vbYrE60= X-Received: by 10.107.148.194 with SMTP id w185mr13733849iod.259.1508653554158; Sat, 21 Oct 2017 23:25:54 -0700 (PDT) MIME-Version: 1.0 Sender: kalle.php@gmail.com Received: by 10.107.7.106 with HTTP; Sat, 21 Oct 2017 23:25:53 -0700 (PDT) In-Reply-To: References: Date: Sun, 22 Oct 2017 08:25:53 +0200 X-Google-Sender-Auth: fZY5gSl3Q0vuNGLzsB1Gresrz6k Message-ID: To: CHU Zhaowei Cc: Sammy Kaye Powers , PHP Internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] Re:[PHP-DEV] [VOTE] Allow a trailing comma in function calls From: kalle@php.net (Kalle Sommer Nielsen) Hi CHU Zhaowei 2017-10-22 7:24 GMT+02:00 CHU Zhaowei : > Hello Sammy, > > > I'd like to know if a trailing comma would affect the number of args or not. for example, > ``` > function foo(){ > return func_num_args(); > > } > foo('a','b',); > ``` > would return 2 or 3? With the current patch submitted for this RFC, your example will return 2, as it will simply ignore the trailing comma at the end of your call. You can see the more detailed test at github here[1]. [1] https://github.com/SammyK/php-src/compare/master...rfc-trailing-comma-function-calls#diff-88d4f8d1ae810e0722bf59cf1a739228 -- regards, Kalle Sommer Nielsen kalle@php.net