Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100176 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41658 invoked from network); 10 Aug 2017 22:40:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Aug 2017 22:40:41 -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.45 cause and error) X-PHP-List-Original-Sender: andreas@dqxtech.net X-Host-Fingerprint: 209.85.218.45 mail-oi0-f45.google.com Received: from [209.85.218.45] ([209.85.218.45:33805] helo=mail-oi0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 98/42-34801-1E0EC895 for ; Thu, 10 Aug 2017 18:40:34 -0400 Received: by mail-oi0-f45.google.com with SMTP id x3so20032302oia.1 for ; Thu, 10 Aug 2017 15:40:33 -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=MTK/8+qdxCov4grOlvXnPyfinN7MpZEMeZIQdfS2GCo=; b=JEA/KHgjLbbm7cyzUt9T8liFc08CCmkeoRi6pZxZ7qMFUTOrur3WHKM7GwhsXU86S5 jgAKfNKBSkinTV/Mx+B/76r8Y5ktaqPy5jxUKdA8Kbhcmw48CzcHURHoy++4UwM13fCd qaI4xde9j7wVevdkPk2c9Zgnow4VO00Ua0js5kLivlF/hwtZnDnoRAb9pmPx3VVTrDAe 1oLqAdRYmmMjSrjxT05xuFO5x0kHDZQ6jtpE94nqUHJESygyd19QFmpDVx8RhWWjZQGv EphAaJpnNnivcJZDH11BEtfgsHm0YcbBoMkwq6UKX1s9T7D/oNZDmrI1nBRQV7ag9ItR g1wQ== 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=MTK/8+qdxCov4grOlvXnPyfinN7MpZEMeZIQdfS2GCo=; b=UQi828t3RiYgetTrb1HkuKY7wZCkQymm14QG9dPUN5xyf1bdhqwqpEU6QqiqqDaeRA oNE/wiHqg/+c5V5NEv3ESUsZBNWW0HbtIG++9ndml1O4TSOrJRTGmL+8vgbr2dT5YbQa eMMUhk7TWIZrfSgjdnfOSM1Ta6cv/CoAuZaEWJ3fOnpGuqc54qZuRmyOnlPEgAyDIK2/ RCDk+aKiW3G1VqDPBbxCM2Ge6XF3SGXQwz0Fav8YdjoGhiD21ZzeccNOl+uCmbVWvMw6 1t6jlg0vOSpCz1ZpMGvigzHCsUyW+sYK0Oe91nJ0VIQ9/w4E9BXRU6TP6K/TAEkq8Rwh 5UUA== X-Gm-Message-State: AHYfb5g2NLGZh44HfsD+fner0WQSD1fdd5qkwt5dZKZoYm/pyNn4Qhnp dFKf3jJcFiXBLesHQbI= X-Received: by 10.202.52.194 with SMTP id b185mr14439175oia.195.1502404830879; Thu, 10 Aug 2017 15:40:30 -0700 (PDT) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com. [209.85.223.172]) by smtp.googlemail.com with ESMTPSA id t76sm8388981oit.5.2017.08.10.15.40.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Aug 2017 15:40:30 -0700 (PDT) Received: by mail-io0-f172.google.com with SMTP id c74so14627809iod.4 for ; Thu, 10 Aug 2017 15:40:29 -0700 (PDT) X-Received: by 10.107.155.83 with SMTP id d80mr11227269ioe.236.1502404829576; Thu, 10 Aug 2017 15:40:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.44.34 with HTTP; Thu, 10 Aug 2017 15:40:08 -0700 (PDT) In-Reply-To: References: Date: Fri, 11 Aug 2017 00:40:08 +0200 X-Gmail-Original-Message-ID: Message-ID: To: Devnuhl Unnamed Cc: Sara Golemon , Dan Ackroyd , reeze@php.net, 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) On Fri, Aug 11, 2017 at 12:01 AM, Devnuhl Unnamed wrote: > Would isset($suffix) not suffice here? You mean like so? list($prefix, $suffix) = explode(':', 'string_without_suffix'); if (!isset($suffix)) { .. } The isset() is too late here, because the list() will already cause an error. > Other concerns fall around list() already being a difficult thing for people to understand I fail to understand what is difficult about it.. And "destructuring" is a common concept in programming languages. https://www.startpage.com/do/search?query=destructuring&cat=web&pl=chrome&language=english https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment The following already works in Javascript: [a, b, c, d = 'else'] = ['aa', 'bb', 'cc']; I just tried it in my Chromium console.