#26662 [Ver->Opn]: Inconsistency in variable setting allows variables that start with numbers

From: Date: Tue, 31 Aug 2004 16:02:56 +0000
Subject: #26662 [Ver->Opn]: Inconsistency in variable setting allows variables that start with numbers
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-65526@lists.php.net to get a copy of this message
 ID:               26662
 Updated by:       betz@php.net
 Reported By:      alindeman@php.net
-Status:           Verified
+Status:           Open
-Bug Type:         Documentation problem
+Bug Type:         CGI related
 Operating System: Linux
-PHP Version:      5CVS-2003-12-18
+PHP Version:      PHP 5.0.1 (cli)
 New Comment:

Updated version, changed category.
php -r '${1} = "foo"; echo ${1}, "\n";'
still outputs foo.


Previous Comments:
------------------------------------------------------------------------

[2003-12-19 07:54:23] sniper@php.net

Then you should set the version correctly, and category..


------------------------------------------------------------------------

[2003-12-18 21:51:46] alindeman@php.net

This is not a dup, as it is not fixed in PHP 5.  Re-opening.

------------------------------------------------------------------------

[2003-12-18 21:42:28] iliaa@php.net

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Dupe of bug #26601 which is marked won't fix.

------------------------------------------------------------------------

[2003-12-18 21:25:21] john@php.net

Confirmed this bug is in PHP 5 B3RC1 as well. It gets worse, you can
put whatever you want in ${} and it'll take it just fine...

------------------------------------------------------------------------

[2003-12-18 21:06:52] alindeman@php.net

Description:
------------
It is possible to set variables that start with numbers.

I reproduced this with a PHP 4.3.x-dev snapshot AND PHP 5.0.0b2 (I was
unable to get a snap to compile.  autoconf errors out the wazoo).

Reproduce code:
---------------
andrew@laptop cli $ ./php -r '${1} = "foo"; echo ${1}, "\n";'
foo

Expected result:
----------------
A parse error

Actual result:
--------------
Outputs 'foo'


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26662&edit=1


Thread (9 messages)

« previous php.bugs (#65526) next »