Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:89960 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91347 invoked from network); 1 Jan 2016 22:11:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Jan 2016 22:11:10 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.181 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.160.181 mail-yk0-f181.google.com Received: from [209.85.160.181] ([209.85.160.181:33610] helo=mail-yk0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/73-06661-D79F6865 for ; Fri, 01 Jan 2016 17:11:10 -0500 Received: by mail-yk0-f181.google.com with SMTP id k129so181148881yke.0 for ; Fri, 01 Jan 2016 14:11:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Zb6tLtWm2y+1qaR+4uD2TRpXfGacJFGkXYFHHVTDwDU=; b=t2nTB7etMHCHVDFVGYfQmRZq2RQa9hOWQgcXiCXuqfJKOf8cyU8KjfKrsn0m7sWtmQ ZIRfiI6sUMPoMmohAK71yTLHh26Z/RfsCG0fQUBp5D1UlIRK9qonebY8lnaxMhJh/OQF XNDNGbpAro2CucIs3FNZIE6GELo5klptwENM4CnQG1+f+32J6Lx3sJ+b7ZibyKFhNOvK 39/U9HNvqKYVr8FCWx7JE9IVAYtTmGqpnCeoU0LWiP6XE0wAoZxM2BJcwosO5GlBcO2X dMhh4OpeSqn+5VDj58ZOanWi0WOozGvOvQeXBYrhD6BZbA+vo8SNOWNlCftzKBGiZCi+ uUGw== MIME-Version: 1.0 X-Received: by 10.13.211.198 with SMTP id v189mr36819304ywd.298.1451686267275; Fri, 01 Jan 2016 14:11:07 -0800 (PST) Received: by 10.129.148.70 with HTTP; Fri, 1 Jan 2016 14:11:07 -0800 (PST) In-Reply-To: References: Date: Fri, 1 Jan 2016 23:11:07 +0100 Message-ID: To: Bishop Bettini Cc: PHP internals Content-Type: multipart/alternative; boundary=001a114da61649605c05284d0cbd Subject: Re: [PHP-DEV] [RFC] On-Demand Name Mangling From: nikita.ppv@gmail.com (Nikita Popov) --001a114da61649605c05284d0cbd Content-Type: text/plain; charset=UTF-8 On Fri, Jan 1, 2016 at 10:47 PM, Bishop Bettini wrote: > Hello Internals, > > Ringing in the new year with a proposal to retool name mangling: > > Mangling has the undesirable consequence that many external variables may > map to one PHP variable. This leads to user confusion and user-land > workarounds, not to mention bug reports. Since register_globals has been > removed, we can replace automatic name mangling with on-demand mangling via > extract(). This allows a one-to-one between external and PHP super-global > variables, while fixing a few bug reports on extract as well. > > RFC: https://wiki.php.net/rfc/on_demand_name_mangling > > Thanks in advance for your feedback! > bishop > I like the idea of getting rid of name mangling, but don't like the particular approach you propose here. In particular anything that will result in an arbitrary number of deprecation notices *controlled by user input* is a no go for me. I think this is one of the rare cases where I would favor the introduction of a new ini setting. E.g. mangle_names=0 disables name mangling, while mangle_names=1 throws a deprecation warning on startup and enables name mangling. mangle_names=0 should be the default. That is essentially disable name mangling, but leave an escape hatch for those people who rely on it (for whatever reason). Furthermore I don't like the suggestion that extract() should start mangling names by default. Currently "invalid" variable names will be ignored by extract(). We can introduce a EXTR_MANGLE_INVALID option for those who want it. Additionally we can also provide an EXTR_ALLOW_INVALID option, which simply extracts "invalid" names normally. (Imho that should be the default behavior. "Invalid" in this context is a misnomer, these variable names are perfectly fine and easily accessible.) Nikita --001a114da61649605c05284d0cbd--