Req #37040 [Opn]: autoconversion of variable names should be turned off
Edit report at https://bugs.php.net/bug.php?id=37040&edit=1
ID: 37040
Updated by: rasmus@php.net
Reported by: indeyets at gmail dot com
Summary: autoconversion of variable names should be turned
off
Status: Open
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
Operating System: FreeBSD 5.4
PHP Version: 5.1.2
Block user comment: N
Private report: N
New Comment:
extract() is able to extract directly into the current scope and would break
without this substitution so it can't be completely removed, but it could be
isolated to the time of the extract() call I suppose.
Previous Comments:
------------------------------------------------------------------------
[2012-07-11 14:46:17] alastair at propcom dot co dot uk
Since register globals is removed in PHP 5.4, there is no longer any
justification for this behaviour and it should be removed entirely.
If anyone else comes up with any justification for this behaviour, then that
justifying factor should be removed because this modifying GET variable names is
completely out of line.
Not that I'm bitter.
------------------------------------------------------------------------
[2006-04-11 14:09:13] indeyets at gmail dot com
to make myself clear:
I propose to turn off substitution of 'dots' with 'underscores' in variable
names only for autoglobal-arrays.
Substitution still should be made for registered globals.
------------------------------------------------------------------------
[2006-04-11 13:49:26] indeyets at gmail dot com
Description:
------------
Currently, PHP does autoconversion of 'dots' in external variable names to
'underscores'. It is documented here: http://ru.php.net/variables.external
It does make sense when application has register_globals enabled and prevents losing of incorrectly
named variables.
Though, it doesn't make sense when register_globals setting is disabled. In this mode, all
external variables are placed inside of associative array, and 'dot' is just as legal for
the key-name as 'underscore' is
Reproduce code:
---------------
<?php
echo '<a
href="'.$_SERVER["SCRIPT_NAME"].'?var.name=value">test</a><hr>';
echo '<pre>';
var_dump($_GET);
echo '</pre>';
?>
Expected result:
----------------
array(1) {
["var_name"]=>
string(5) "value"
}
Actual result:
--------------
array(1) {
["var.name"]=>
string(5) "value"
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=37040&edit=1
Thread (6 messages)