Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89121 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30065 invoked from network); 9 Nov 2015 15:24:05 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Nov 2015 15:24:05 -0000 Authentication-Results: pb1.pair.com smtp.mail=danack@basereality.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=danack@basereality.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain basereality.com from 209.85.160.171 cause and error) X-PHP-List-Original-Sender: danack@basereality.com X-Host-Fingerprint: 209.85.160.171 mail-yk0-f171.google.com Received: from [209.85.160.171] ([209.85.160.171:34838] helo=mail-yk0-f171.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 78/91-13667-39AB0465 for ; Mon, 09 Nov 2015 10:24:04 -0500 Received: by ykek133 with SMTP id k133so269701332yke.2 for ; Mon, 09 Nov 2015 07:24:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=basereality_com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0eIHUJO/spPqYxXPN7UFhYWh5oxGC9dZ6tmXar7no5E=; b=VlDKDRFk5+1HVs9GZ/ZTTck3dzHEV06jBBgh7hVuvMCPGK97Fv1PbdRhzK1wWhxz9D vKiZF4AXaImfPLkCG1eguUrW+qWoqJAdnM0ib0+BlzBgMJ+6Uzq3Xs9c0Mp9OSeeu+iI L8R8hkXqytGuBRkyNXLNNygzBd6Ck1xIvAzkb4SeN5NyQiboemCS1c9jwXI5jNOteOWS 8I9UGjmGOKHmEw9D2LUKIOMwaaS0WysrNFsKS+u8B7h3Qr6e0v3CN5qWvEBG5roUUxrT 1FgEFeYdIrq9wTTCbNvgotMJ86zviqNMGB5JnL9oI7V6TXv4tzWWjbTkGeMrlR6nmz8N r1bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=0eIHUJO/spPqYxXPN7UFhYWh5oxGC9dZ6tmXar7no5E=; b=k+RPMYDxT7Jhl1n2oBGZAXnhbk1iD5xrOJVK5vIk7tMxCZMT44QF1Di5GGvTWJ5mmn 29PJpvTx3HRB4TtmCC4b5uqdVepyspqsF1EYjY0jaQFbJIT3BMhWkwrLgh7kyRnaaObQ O/FFZPPNupQNS7EwfKytqfKqFVpZtkCPaEhled3rX3Cx9g4FxtbE9tFWeg8GmWOhy6tL 2iOSFvhg1XqRvU2iC01Lb8eFUnfOSnpnbLUjqRPDhJ8yo84y8yPCxIu8GveU1bsh0cdP 6qyqfCYLlZIf5jCxNpDVNXab0ZNYbpDA52osw5/XGXw9k/rN7g2dZL2N2mgtB4SuZrhc 8gYw== X-Gm-Message-State: ALoCoQnCSYWI0hyib6n6l5Wd7wMs+xT/RFEcTtxUuQCgk/LukSNmz7ma1ch5CIW9GhGautXdmymK MIME-Version: 1.0 X-Received: by 10.129.125.193 with SMTP id y184mr5692375ywc.182.1447082640248; Mon, 09 Nov 2015 07:24:00 -0800 (PST) Received: by 10.37.112.69 with HTTP; Mon, 9 Nov 2015 07:24:00 -0800 (PST) X-Originating-IP: [2.96.88.152] In-Reply-To: References: Date: Mon, 9 Nov 2015 15:24:00 +0000 Message-ID: To: reeze Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][DISCUSSION] Allow default value in list() syntax From: danack@basereality.com (Dan Ackroyd) Hi Reeze, On 9 November 2015 at 13:35, reeze wrote: > Hi internals! > > I'd like to open a discussion on the RFC to allow set default values for > list() assignment: https://wiki.php.net/rfc/list_default_value. > > What is your idea? I find the list construct to be quite magic already. Isn't it possible to get the affect that you want without adding anything to the core by doing this: $defaults = ['default', 'default']; $input = [1]; list($a, $b) = array_replace($defaults, $input); I'd find that way easier to understand and explain to junior devs, compared to having more functionality added to the 'list' magicness. cheers Dan