Re: Why is this happening

From: Date: Tue, 17 Apr 2001 21:38:51 +0000
Subject: Re: Why is this happening
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-49066@lists.php.net to get a copy of this message
Some time ago, if I remember correctly, this question was asked. Rasmus replied that the interpreter, due to its mechanization, would interpret "raw" strings as strings in associative arrays but that THIS BEHAVIOUR WAS NOT GUARANTEED IN THE FUTURE. It had something to do with the symbol table mechanization. One has to admit that "raw" strings are, per se, illegal in the PHP language definition. --------------- "Boget, Chris" wrote: > > Ok, I found out what the problem was. I'm still curious > why the problem is occuring. > > > if( $tmpArray[errorNumber] & $typesToDisplay ) { // line to comment out > > I almost always access associative arrays like the above - > almost never without the quotes. IE > > $there = 5; > > echo "$this[that]<br>\n"; > echo "$joe[bob]<br>\n"; > echo "$here[$there]<br>\n"; > > etc. > > And so when I tried to access that element in $tmpArray, I > did so w/o using the double quotes. As soon as I added the > double quotes, however ($tmpArray["errorNumber"]) the > problem corrected itself. The arrays iterated through as they > should have (and did when the line was commented out). > > Why would using the double quotes in this situation have > fixed the problem with the infinite loop? > > Chris -- Justin Farnsworth Eye Integrated Communications 321 South Evans - Suite 203 Greenville, NC 27858 | Tel: (252) 353-0722

« previous php.general (#49066) next »