Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105095 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 49490 invoked from network); 5 Apr 2019 11:07:53 -0000 Received: from unknown (HELO mail-ed1-f49.google.com) (209.85.208.49) by pb1.pair.com with SMTP; 5 Apr 2019 11:07:53 -0000 Received: by mail-ed1-f49.google.com with SMTP id q3so4696163edg.0 for ; Fri, 05 Apr 2019 01:03:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=Fg15sVwFp6/VkLkOst87eJnM/lTLvq+8HUd8t5hQHio=; b=anJ8SPK4R2KXE/AAFx7IS45Yybe5OxFY6p3+K3DDFMkj0kHj9/xEDptawsDCpzEWJH Tyj3MrOMrazm0Pf97iq0HzSphXgT2ot78p/lQiOTcgFhojqhshSSKa4HKLRoedVZJBFC 17N+tDVvupuEsjyG8eEF+30+KWt05VrXIvUuQVdRysYmCBxOesERxVGBqbRBxQTOoRcD rKT1xFgIj9mkOFHw+bISCNSLLKJK7GnA8W7Xog7hWWrTJ1C5D34Av8XTKifLOhoOkYlu V/f2JLfJh3Rh7M1U7cNmdv0Yy5vTmFZe1tQI/43N0wuOMRBiFDZh+T14k64uO+aNxJ/N o9Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=Fg15sVwFp6/VkLkOst87eJnM/lTLvq+8HUd8t5hQHio=; b=BBwmD1ZR9rT7bTOqnh+BNCbXz+gGdEAhWtapcREwzWaSR0+mcf/rK8w7et3HiEVO3k suXq7n4zC5by6z2NmxzFFUMH+8meovte9Dtedq4WdAkcIyZbXdCcypGry8tyHR9PGikx tRHmb5yvaYcFbZx1XCpAl/rfXVCGaztqDXqcezdoSMl0Uqa8jk55PfFrfmy+RmWvvzu+ lpnGWIV+dsTq679z4IWa8KbLEAxFGViEYwEVKtRpdIr6Oo/2GgZ1QfOCn6Jb2cYtE7lM RYJYxw7FPC9ZH30D+bhaKm03hImCwj5m3wilvRRjCctszaAEgXgH7nxdz3JlAUAfdmLj wGZw== X-Gm-Message-State: APjAAAUURMIDlXidsWstGs0nJV+7jCTXMcmvyVcUrDptWp/nVGPOv2ts DPxXdlIdhxJx1YPMO4Cnlqm4vI/hnYQ= X-Google-Smtp-Source: APXvYqwpWMMA0pd6H+FKEmatZsfcDRx3DCRhrfCn/SeQ37DginWUz+j9mXdkrG8+KXFsA1EThY7iIQ== X-Received: by 2002:a17:906:eb87:: with SMTP id mh7mr6139138ejb.152.1554451423157; Fri, 05 Apr 2019 01:03:43 -0700 (PDT) Received: from [192.168.0.63] (84-75-30-51.dclient.hispeed.ch. [84.75.30.51]) by smtp.gmail.com with ESMTPSA id p23sm2901005ejr.74.2019.04.05.01.03.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Apr 2019 01:03:42 -0700 (PDT) Message-ID: <07B1B207-1FCE-412F-837A-6956DCCA1F51@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_03E2B99A-7C1C-4A87-A29E-7C2F206C0A4E" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.8\)) Date: Fri, 5 Apr 2019 10:03:40 +0200 In-Reply-To: Cc: CHU Zhaowei , PHP internals To: Stijn Peeters References: <003a01d4eaf0$c17d6c20$44784460$@jhdxr.com> X-Mailer: Apple Mail (2.3445.104.8) Subject: Re: [PHP-DEV] [RFC] Spread Operator in Array Expression v0.2 From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_03E2B99A-7C1C-4A87-A29E-7C2F206C0A4E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 5 avr. 2019 =C3=A0 09:45, Stijn Peeters a = =C3=A9crit : >=20 > Hi, >=20 > If I understand correctly it is possible in this proposal to use = normal arguments after using an unpackable argument: >=20 > $arr4 =3D array(...$arr1, ...$arr2, 111); //valid >=20 > This is something that is not possible when using argument unpacking = in function calls: >=20 > $result =3D someFunction(...$arr1, ...$arr2, 111); //invalid >=20 > While I personally like the more permissive variety in this RFC, I = think this could be a confusing inconsistency, and for clarity's sake it = would be better to keep both instances of the unpacking syntax as = consistent with each other as possible. >=20 > Best, > Stijn=20 >=20 >=20 That begs the question: why is this invalid for function calls? In fact, I am able to easily hack around the limitation: $result =3D someFunction(...$arr1, ...$arr2, ...[111]); // valid but the limitation seems just an unnecessary annoyance. =E2=80=94Claude= --Apple-Mail=_03E2B99A-7C1C-4A87-A29E-7C2F206C0A4E--