Re: Something difference betwen php-4.0.3 and php-4.2.3

From: Date: Thu, 23 Jan 2003 18:55:32 +0000
Subject: Re: Something difference betwen php-4.0.3 and php-4.2.3
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-132883@lists.php.net to get a copy of this message
As you noted, there really should be while ( $j < $i ) because $i is incremented after last element to $selectTab is added. But it still should not die quietly. Do you have display_errors off? andre.lagadec@education.gouv.fr wrote:
Hi There is no error or notice message on the screen and in the log of the web server. The PHP program stop and don't generate all the HTML code of the page. Marek Kilimajer a écrit :
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
     


« previous php.general (#132883) next »