Hi, I modifiy my php.ini to redirect error message in log of server web and I change error_reporting = E_ALL & ~E_NOTICE by error_reporting = E_ALL
Now, I get in server log this message : [24-Jan-2003 08:59:31] PHP Notice: Undefined offset: 4 in /appli/PHP/test/__xyz__.php on line 15 and I get all code HTML : the program doesn't fail ! So, PHP detect an error, but it work. It's strange ! What do you think about that ? AL Marek Kilimajer a écrit : > 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? > > [EMAIL PROTECTED] 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 > >> > >>[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