Odd variable Bug

From: Lost arcade (gladstone1_at_adelphia.net)
Date: 07/31/04


Date: 30 Jul 2004 17:18:41 -0700

I am using PHP 4.3.4 and found something strange with a variable name.
When I try to use "$company" variable (lowercase), I get odd behavior
from that variable. The name of my php file is "company.php" but I
didn't think that php associated them together. The behavior is that
"$company" will take on values of the previously accessed $_GET
variable. I fixed it by using "$company_info" variable instead but I
would really like to know why the "$company" variable seems to be a
landmine.

The code includes the core Pear libraries and the pear IT library but
nothing else. I thought that system variables took the form of
"$_VAR"?

If anyone has run into odd behavior like this before let me know so I
can
find out what variables to avoid in the future.

Sam



Relevant Pages

  • Re: Odd variable Bug
    ... >> didn’t think that php associated them together. ... >> landmine. ... >> The code includes the core Pear libraries and the pear IT library ... >Sam, that behavior is due to register_globas being ON. ...
    (comp.lang.php)
  • Re: Odd variable Bug
    ... >didn't think that php associated them together. ... I thought that system variables took the form of ... Official Proof of Purchase ...
    (comp.lang.php)