Re: Something difference betwen php-4.0.3 and php-4.2.3
| From: | Marek Kilimajer | Date: | Mon, 20 Jan 2003 10:58:01 +0000 |
| Subject: | Re: Something difference betwen php-4.0.3 and php-4.2.3 | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-132233@lists.php.net to get a copy of this message | ||
I have never heard of "out of range" error, but is it really an error or just a notice? If it is a notice, adjust error reporting to not display notices
andre.lagadec@education.gouv.fr wrote:
Hello, I try to move an Web application in Php-4.0.3 to php-4.2.3, and some programs don't work well on some pages. I make search in the code, and after tests, I find that the following code doesn't work in php-4.2.3, but works in php-4.0.3pl1 ------------------------------------------------------------------------------------ <html> <body> <form> <? $i = 0; while ($i<=3) {$selected = ""; $selectTab[$i] = "<option value='".$i."' ".$selected."> bla bla</option>\n";$i++; }printf("<select name='filiere' multiple size='%d' class='textNoir'>\n", ($i-1) ); $j = 0; while ( $j <= $i ) {printf($selectTab[$j]); $j++; }printf("</select>"); ?> </body> </html> ------------------------------------------------------------------------------------ It's because there is an error in the code : this instruction is wrong while ( $j <= $i ), there is an "out of range" in the array selectTab[] when $j=$i=4 the good instruction is while ( $j < $i ) Is there something changed in the gestion of the error "out of range" in an array betwen php-4.0.3pl1 and php-4.2.4 ? Thanks for your help ? AL