Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Declaring arrays

sometimes errors, sometimes not

4:55 pm on Jan 3, 2008 (gmt 0)

Junior Member

10+ Year Member

joined:July 28, 2006
posts: 168
votes: 0

Hello, I am wondering why the exact same code, one running on 2 different enviornments gives me 2 totally different results.

Windows IIS PHP 4.7...
and one running on
Linux Apache PHP 4.2...

$someArray[1][1] = "ABC";
echo $someArray[1][1];


$someArray[1][1] = "ABC";
echo $someArray[1][1];


I then realized that if i declare $someArray[1] = array(), it then works on the Windows version. This is ok except i have a whole bunch of code that works on the Linux enviornment and not the Windows, is there a way to change a setting in the PHP configuration to not force me to have to declare the variables as arrays before attemping to use them?


5:34 pm on Jan 3, 2008 (gmt 0)


WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 31, 2003
votes: 2

Doesn't make sense, really. I wonder if that echo in the Windows version is printing the letter "A" from the first word in "Array" or something? Change the value from "ABC" to "XYZ", make sure you are running the exact same little snippet shown here on both servers and see what your output is.

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members