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

[EMAIL PROTECTED] 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




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to