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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri Aug 15 19:00:03 2025 UTC