Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100190 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28847 invoked from network); 12 Aug 2017 00:38:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Aug 2017 00:38:07 -0000 Authentication-Results: pb1.pair.com header.from=andreas@dqxtech.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=andreas@dqxtech.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain dqxtech.net from 209.85.218.41 cause and error) X-PHP-List-Original-Sender: andreas@dqxtech.net X-Host-Fingerprint: 209.85.218.41 mail-oi0-f41.google.com Received: from [209.85.218.41] ([209.85.218.41:36242] helo=mail-oi0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8F/D9-34801-FED4E895 for ; Fri, 11 Aug 2017 20:38:07 -0400 Received: by mail-oi0-f41.google.com with SMTP id g131so46741052oic.3 for ; Fri, 11 Aug 2017 17:38:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dqxtech-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lCuN+bTh6nu0WM8dMqNX9hlQ/H/s50gYRPNMopiQOXE=; b=WFyARCc2/D+IkL0rc5OHoBj01o88jSQo+uQ8iUcOdnfy7HGX7V915DYvMxpc3rIxd/ N0aLEFU/eJ63jIj3wB2dODvH2YYGTQuVKM1za0jh4e3GuvVGGCDCEYSfeeFb7/qca4dG //Caunc9vdKzwLodIuPYSR52KGG67lewPiaLRY+FOwC0MqOtrmPF1Votp06USxW0bxRK wxZzMTwF4+6sdK/UCZbekqVq6ndJ6uzNwvAxqipMPTdnXfEAMWtJT/jGWz8TkV/84LZs qIQwo1xWgNGmUXOA41j//yCtGMpk635pY0zkMtghpnda6Ma1ZCDfBI8P5Q0gPknKZzoq NxHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lCuN+bTh6nu0WM8dMqNX9hlQ/H/s50gYRPNMopiQOXE=; b=hS/DChE73B0pOh1IziTJtX4whbmdCGeNWT1llJ5D7l0kTWo5XdD/524Nnhl2njSzfW ZpoaWvlYth/fQ4k3hWxwHSp9JCIYRveWOJhVEneAmuk6dEHOWYdCtACj1Ll7Na5DQhdI JdiLMGvReojT/eDR2fP11uJB01wRJQtResN+/0dyCLIPZOrD7uJJ7UwgdEaMAtBpgf5+ 7Ew4u13mNzWG9/rCZ4XzpH+x4owqN6nBao209NmvI9QR9oG0KxzbqqDY5uylUXpQsSuv HtcmA0S3/mYAPKOiXDj3wLwKLk7ahX3yIy8OD6vPKMb1Ivc+hvurOsDWi3nHRMY6GIAf u89A== X-Gm-Message-State: AHYfb5g9F2MfgGieD35dUZp5TM0G2Hk62sNsndyMPoJb66MArY9oD7UK GLS87+BZDUItPx9GzC8= X-Received: by 10.202.6.193 with SMTP id 184mr20863850oig.269.1502498284533; Fri, 11 Aug 2017 17:38:04 -0700 (PDT) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com. [209.85.223.175]) by smtp.googlemail.com with ESMTPSA id t70sm2303484oif.38.2017.08.11.17.38.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Aug 2017 17:38:03 -0700 (PDT) Received: by mail-io0-f175.google.com with SMTP id g35so25274547ioi.3 for ; Fri, 11 Aug 2017 17:38:03 -0700 (PDT) X-Received: by 10.107.35.140 with SMTP id j134mr15174696ioj.94.1502498282978; Fri, 11 Aug 2017 17:38:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.44.34 with HTTP; Fri, 11 Aug 2017 17:37:42 -0700 (PDT) In-Reply-To: References: Date: Sat, 12 Aug 2017 02:37:42 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Andreas Treichel Cc: PHP internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Allow default value in list() syntax From: andreas@dqxtech.net (Andreas Hennings) This is true, I remember having done it in the past. I still think it would be nice and feel natural to have the default values directly built into the list construct. It would be a bit faster, because it does not have to allocate a new temporary array. Whether this difference matters depends on the case. In my own philosophy, every code that I write to be reusable, could at some point be used in a situation where it is repeated a lot, and thus has a performance impact. So for my taste, it does matter. This said, I understand it not having the greatest priority. On Fri, Aug 11, 2017 at 7:46 PM, Andreas Treichel wrote: > You can merge the result with default values like this: > > [$foo, $bar, $foobar] = explode(':', 'foo:bar') + [23, 42, 1337]; > var_dump($foo, $bar, $foobar); > > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >