Form variables with - in their name
| From: | Zeev Suraski | Date: | Sat, 15 Jan 2000 15:48:55 +0000 |
| Subject: | Form variables with - in their name | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14653@lists.php.net to get a copy of this message | ||
The post on the PHP3 list made me check our handling of form varibles with
- in their name. It seems that currently we don't handle them in any
special way, and they simply get into our name space.
This is unlike our handling of form varibales with . or a space in their
name, in which case we convert it to _.
My question is whether we should publish this as the documented behavior,
in which case it's only possible to access these variables using indirect
reference (i.e. using ${"foo-bar"}), or should we make it autoconvert to _
as well.
- isn't the only character in question - most other operator characters
aren't valid character names in PHP.
My personal feeling about this is:
1. We shouldn't change the current behavior, and let people access such
variables using indirect reference.
2. For consistency, we should behave in the same way with spaces and
dots. Because of the incompatibility implications, I'd make this runtime
selectable (using an INI directive).
Zeev
--
Zeev Suraski <zeev@zend.com>
http://www.zend.com/