Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89966 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48241 invoked from network); 2 Jan 2016 16:45:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Jan 2016 16:45:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.49 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.49 mail-wm0-f49.google.com Received: from [74.125.82.49] ([74.125.82.49:33844] helo=mail-wm0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 47/21-33667-6CEF7865 for ; Sat, 02 Jan 2016 11:45:59 -0500 Received: by mail-wm0-f49.google.com with SMTP id u188so106043696wmu.1 for ; Sat, 02 Jan 2016 08:45:58 -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=isB0FPwNuBiCdmJi2kRNvZlvqtNkXZlmLdFCL0G2zCk=; b=UXGhRduQSNvbD+LLhpxClivNirJrydX9HFOvR8VzzcQgkq3csKgbqsVoQxcjJTFmZs MCUG60r9Ba4rxbmEdgI0Y4Etp7QaNNZXjVpSy4bd2js/nts0/abSyjmw5UtiIB7/Dtx+ DDLgmS8Oluf04sPi+FZYoso6EX5YPF99JhEqtWhlKJrLPaqrV8gCtYxngEtSB+Nekr51 n3EgLfpr9vUitNKoG3OM0aPqW+t5I7nkpS7XxbU57Rz7CWu267rc4fwuIa53Khe1IedO PWnL+kpMwNMWktDxWNBSKgyL9FED6yRy4u2kMRoiuayAdSkL9ewLcVv1nKAFIl52yqlk wG9w== X-Received: by 10.194.133.100 with SMTP id pb4mr102560331wjb.133.1451753156181; Sat, 02 Jan 2016 08:45:56 -0800 (PST) Received: from [192.168.1.189] ([2.31.24.87]) by smtp.googlemail.com with ESMTPSA id l194sm43063997wmb.14.2016.01.02.08.45.55 for (version=TLSv1/SSLv3 cipher=OTHER); Sat, 02 Jan 2016 08:45:55 -0800 (PST) To: internals@lists.php.net References: Message-ID: <5687FEC0.8010103@gmail.com> Date: Sat, 2 Jan 2016 16:45:52 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] On-Demand Name Mangling From: rowan.collins@gmail.com (Rowan Collins) On 02/01/2016 03:09, Bishop Bettini wrote: > But, even without a setting, there's an escape hatch: userland can polyfill > the mangling behavior using extract. The updated RFC demonstrates an > algorithm. I'm not that comfortable with requiring / encouraging the use of extract() - a rather awkward function which clobbers your local variable space in unpredictable ways - to write the polyfill. The fact that the clobbering is necessary / useful for extract() is wholly unrelated to the need for BC in super-global arrays. It would be more useful to expose a method or regex constant to userland so that the mangling can actually be done in place on appropriate arrays: $old_get = $_GET; $_GET = []; foreach ( $old_get as $old_key => $value ) { $new_key = preg_replace(PHP_ILLEGAL_NAME_REGEX, '_', $old_key); $_GET[$new_key] = $value; } Regards, -- Rowan Collins [IMSoP]