Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:105121 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 44018 invoked from network); 6 Apr 2019 08:41:00 -0000 Received: from unknown (HELO mail-pl1-f194.google.com) (209.85.214.194) by pb1.pair.com with SMTP; 6 Apr 2019 08:41:00 -0000 Received: by mail-pl1-f194.google.com with SMTP id bf11so4138485plb.12 for ; Fri, 05 Apr 2019 22:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=INWs7k5jdxJlCN5E5dTJjxIzyShs+VQMt7jX84oGbew=; b=TUGHhr3xLXhKxSdAsfHqgD2SzQ7iYiGaGL/Uzt1alj9/4KEma33x7n2xmBQ6mRH/h7 SjQipo6BAE5kNT7YleGgIuoU1tqLltx477hZkDiecgLrV6vVKXE8MHv1ohvPL0QqMjVd zgWyQfKg+jkfJoEFF8GlKRPxT9vvWjB95ygZ+wPOB3L5ix6lbJ2/UcuNY/2VIwEh1Po0 /t8GsJSi+h6WhVj3+8kMjCeD7nbSrMkEZXKoGU989X0TYGDxjkhYwXzzknk+wfwiWn50 2vnEedLxNFC2xzYT9nrkD8m/KrbZeQNSnXbXwNdsoXtsYyVWtHrg/AmqDt89LGgTnr2F aSyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=INWs7k5jdxJlCN5E5dTJjxIzyShs+VQMt7jX84oGbew=; b=jE+YD9aAcPWpJSGa7FhmNSgoWvM7pKwp+lWGm2O5tK5x/9nOraVKueCG3XnbmxB39s QPB0X6+LXmTpMkAvy/5qAqrq6tB9mf93wVi79AEcOvK4aNBToKePyq4FUJArugNkMp1B RH159JCPqrWix4aq+npQhWm1ZuIkwnhC7o9LlVFTjZAoP+Zz5YS3M/151ulo5wlSJ3OJ aQIlgEQlLfc8WYxp1W1K7RUi6xm9EGbvZCUdweppDofm6AJQ8Z9j5jQrL3BKjHbnIu/q g0SAy+rPYZsAX0Q/2RC72mGalI8/jdPeRWo4CAm7XoDhzPYC1kfG0DlC1mbMGVl+WmMm vTVg== X-Gm-Message-State: APjAAAUPb9Bxw0HWlQ1S6nL3vkltccXL/31rM4o0QvSjzS+lXVzKwA+C ptRMLm8m/gfHfwVTnjBHbnyKLl7PLdkG1CgI491q7A== X-Google-Smtp-Source: APXvYqwE1JMuVcJ2xUxQDY9FuFwLVl/t2JUHjSNK5nTQkHtbFNGpe5REyRxSehaQWgP3VdX56HLtazhnRXePF8ZeOj0= X-Received: by 2002:a17:902:b68e:: with SMTP id c14mr16794326pls.49.1554529023520; Fri, 05 Apr 2019 22:37:03 -0700 (PDT) MIME-Version: 1.0 References: <003a01d4eaf0$c17d6c20$44784460$@jhdxr.com> <07B1B207-1FCE-412F-837A-6956DCCA1F51@gmail.com> In-Reply-To: <07B1B207-1FCE-412F-837A-6956DCCA1F51@gmail.com> Date: Sat, 6 Apr 2019 06:36:50 +0100 Message-ID: To: Claude Pache Cc: Stijn Peeters , CHU Zhaowei , PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Spread Operator in Array Expression v0.2 From: Danack@basereality.com (Dan Ackroyd) On Fri, 5 Apr 2019 at 09:03, Claude Pache wrote: > > That begs the question: why is this invalid for function calls? At least in part, because if we ever wanted to add a standard _toArray() method, like we have __toString(), it would be quite a massive BC break if we already made it so that PHP automatically encased a single variable into an array, where an array was expected. > In fact, I am able to easily hack around the limitation: > > $result = someFunction(...$arr1, ...$arr2, ...[111]); // valid > > but the limitation seems just an unnecessary annoyance. Typing a couple of extra characters, to avoid needing extra magic behaviour, seems a good trade-off to me. cheers Dan Ack