String concatenation problems
| From: | ericnielsen@earthlink.net | Date: | Wed, 07 Mar 2001 19:35:05 +0000 |
| Subject: | String concatenation problems | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-42943@lists.php.net to get a copy of this message | ||
I posted a related question yesterday with no response. I've done some more investigating and
think I can lay some of the blame on the string concatentation operation. If anyone can tell me
what might be causing this behavoir I would greatly appreciate it.
the following code shows the rough form of what I am doing....
for ($i=0;$i<100;$i++)
{
$returnVal = "\t<TR>\n";
$returnVal .= "\t\t<TD><FORM><INPUT TYPE=\"HIDDEN\"
NAME=\"name\" VALUE=\"$i\">\n";
$returnVal .= "\t\t\t<INPUT TYPE=\"SUBMIT\" VALUE=\"Do it\">
</FORM> </TD>\n";
<snip -- other similar cells being created>
$returnVal .= "\t</TR>";
$returnValArray[$i]=$returnVal;
}
return $returnValArray;
--- Problem description:
Some rows are corrupted.
The type of corruption that occur are
a) an incomplete row is in $returnVal before assignment to the array, the incomplete row is always
stopped partway through the addition of a string, ie
"ABC"."DEF"->"ABCD" sometimes
b) a doubled row. The initial $returnVal assignment is skipped causing two iterations throuhg the
for loop to build up on the returnVal variable.
c) unknown. in some cases, after the assignment of $returnVal to $returnValArray[$i] the array
version will be corrupted while the originl is not.
What is happening here? As mentioned this problem only materializes on an older machine (P133 with
64MB ram) not on the development machine (PIII700 with 128MB). The productio server runs AOLServer
while the development server runs Apache.
Eric Nielsen
--------------------------------------------------------------------
Mail2Web - Check your email from the web at
http://www.mail2web.com/ .