Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46842 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 7541 invoked from network); 20 Jan 2010 22:23:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jan 2010 22:23:38 -0000 Authentication-Results: pb1.pair.com header.from=sv_forums@fmethod.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=sv_forums@fmethod.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fmethod.com from 69.16.228.148 cause and error) X-PHP-List-Original-Sender: sv_forums@fmethod.com X-Host-Fingerprint: 69.16.228.148 unknown Linux 2.4/2.6 Received: from [69.16.228.148] ([69.16.228.148:52620] helo=host.fmethod.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 97/63-26239-962875B4 for ; Wed, 20 Jan 2010 17:23:38 -0500 Received: from [83.228.56.37] (port=3854 helo=pc) by host.fmethod.com with esmtpa (Exim 4.69) (envelope-from ) id 1NXixa-0002F7-Km; Wed, 20 Jan 2010 16:23:35 -0600 Message-ID: To: , "Nathan Rixham" References: Date: Thu, 21 Jan 2010 00:23:38 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.fmethod.com X-AntiAbuse: Original Domain - lists.php.net X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - fmethod.com Subject: Re: [PHP-DEV] Dots and spaces in variable names are converted to underscores. From: sv_forums@fmethod.com ("Stan Vassilev") > Dots and spaces in variable names are converted to underscores. For > example becomes $_POST["a_b"]. > > Any reason why? and any way to modify this behaviour to preserve dots > and spaces? (dots specifically) I'm also using dots for this reason, so I feel your pain. What I ended up doing is converting dot syntax to PHP array syntax as I compile my templates. So when I type this: what I get actually compiled and sent to the browser is this: The reason for this quirk is register_globals. The symbols not suitable for symbol names, such as dots, are replaced with underscores, so that you can access your POST variable "foo.bar" as $foo_bar in global space. Of course it never made sense the conversion is applied to the superglobals like $_COOKIE/GET/POST, but it was, and now there are claims that it'll break backwards compatibility if changed. I hope PHP6 will remove this processing as register_globals will be completely removed at that point. Regards, Stan Vassilev