Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:90697 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92316 invoked from network); 18 Jan 2016 12:52:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jan 2016 12:52:06 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.45 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.45 mail-wm0-f45.google.com Received: from [74.125.82.45] ([74.125.82.45:38757] helo=mail-wm0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/E9-20254-5FFDC965 for ; Mon, 18 Jan 2016 07:52:06 -0500 Received: by mail-wm0-f45.google.com with SMTP id b14so121439789wmb.1 for ; Mon, 18 Jan 2016 04:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=6WlENYQBXeLtVkIu31BWSG9lqmi9gZuWdBp19hX7Ewc=; b=jgpyZyIUxMsprOj0p2xtSsmtlQw0jz4mPRoKiRfLOzRgB/DdMJW3DL0XoeQ4hr5vgI jI/GFU5iQmgclLdLV+VEZZGtWocRyQnCd5F3Bm3QT8i1Y7CfyGnFROTDs6GMNEwW8Qm4 R9CkBxWm7iED0nXGmHQFfuV+uZNSZuOtETu9/Uq9hIgHR7cUzlyfUXkirCub9hH4Opso QcUWXd1k/j6M3wPP1OfpyBxTOWDxPHFLsyATI6P6DIs0gvO5fbQJ3DiLD4AsImvq5bb9 TfZnzfFT+JzK8cdayYL1Qcl8Efb0WBcvJCtNGY0sga1VUidk+nMEmtGDwfvejUXkvph2 XlCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=6WlENYQBXeLtVkIu31BWSG9lqmi9gZuWdBp19hX7Ewc=; b=REI9m5P1Ys6ygPR1rYuBNW97652vvwzIieaaQYyDxQfXQ0O99wEXjNny8dnXUWXQuF tv8S5U1BXwSvMHWjQkxn0omnyZ0yJCmK8fD8ADSZwmpbbH4F2SXzxCdIklQLcObrfcHf bpB7xy34T32Z0kVPacEHCNivq290zxPWr8NBwju3oFy1nzGc/+uvji6NaE3MOkg84f0Q uOt9V7dBQtiodV8ChnYpHrCxS7ej8k2DpJi9ku81qG+rRG0a/u9xvyptN1SM7i1Q1jj6 BQUYsHZKxrotIqvqUip0GcpBmGB/NadWU18u5EgY6+Y3YUvuQJimy2aeFuN37k0dH0Ga 2J+g== X-Gm-Message-State: ALoCoQmmvEy5JYa1kEr7OTE0vJpSJlT4gTBvVryap9y/Reqfco71juVqGyF+NE7+8Lx5rJLYox9MOiwtVbwtX9KXWrSgxomgSQ== X-Received: by 10.194.187.240 with SMTP id fv16mr24137426wjc.39.1453121523226; Mon, 18 Jan 2016 04:52:03 -0800 (PST) Received: from [192.168.0.177] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id s2sm23653102wjs.43.2016.01.18.04.52.02 for (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jan 2016 04:52:02 -0800 (PST) To: internals@lists.php.net References: <3B.E6.32157.D3DFA965@pb1.pair.com> <569C91FE.8030605@php.net> <569CDC1C.2070304@lsces.co.uk> Message-ID: <569CDF94.9070500@gmail.com> Date: Mon, 18 Jan 2016 12:50:28 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <569CDC1C.2070304@lsces.co.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Allow specifying keys in list() From: rowan.collins@gmail.com (Rowan Collins) Lester Caine wrote on 18/01/2016 12:35: > As someone still using 'extract' in legacy code, I can sort of see the > logistics of this, but why not just extend 'extract' to use the current > object rather than the symbol table. It already has handling for > duplicate keys and to prefix the 'array' name to the resulting variables. The main advantage I can see is that this is a whitelist-based approach - you state explicitly in your code what you expect the array to look like, and what variables you are assigning based on it. This is very different from "whatever's in this array, turn it into a variable". The "current object" was just one possible use case, have a look at some of the other examples in the RFC, such as: list( CURLOPT_GET => $isGet, CURLOPT_POST => $isPost, CURLOPT_URL => $url ) = $curlOptions; Note that $curlOptions probably had other things in it, $url may be an existing variable getting a new value. The best extract would give you is $curloption_10002, which isn't all that useful. Regards, -- Rowan Collins [IMSoP]