php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16637 Environnement variables collision
Submitted: 2002-04-16 12:22 UTC Modified: 2002-04-17 05:42 UTC
From: R dot Hermann at ulg dot ac dot be Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.1.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: R dot Hermann at ulg dot ac dot be
New email:
PHP Version: OS:

 

 [2002-04-16 12:22 UTC] R dot Hermann at ulg dot ac dot be
Hello, 

After updating to MDK 8.2 - PHP 4.1.2. I encoutered serious troubles with my php website. I managed to solve it and relate it to an environnemental variable problem.

This script :

<?
 echo $out."<BR>";
 $c=1;
 $out[$c]=153.2;
 echo $out[$c]."<BR>";
 $den[$c]=153.2;
 echo $den[$c]."<BR>";
 phpinfo();
 ?>

Gives the following output :

/dev/vc/
1
153.2


This may be a problem, since a lot of new variables have been defined which have lower case names and are quite common ( examples : $out,$res, ...). Furthermore, the content of an array having the same name as predefined variables seems to be seriously affected.

We found that defining the array with 

$out=array();

helps fixing the problem.

I thought you might be interested.


Best wishes,

Raphael

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-17 05:42 UTC] hholzgra@php.net
never trust uninitialized variables,
especially not with register_globals=on in php.ini


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 13:01:34 2024 UTC