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

From: Date: Fri, 24 Jan 2003 09:12:31 +0000
Subject: Re: Something difference betwen php-4.0.3 and php-4.2.3
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-132956@lists.php.net to get a copy of this message
andre.lagadec@education.gouv.fr wrote:
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 ! That is working correctly, it is what should happen. You changed your error reporting to include "notices". These are not errors but warnings to tell you that you _may_ have something not right.
In this case, an undefined offset means that the variable you used in the offset has not been previously set a value, so: $myarray[$myoffset]; will produce this error if $myoffset has not already been set a value. If you do: $myoffset = 4; $myarray[$myoffset]; then you should not get the warning. HTH Chris

« previous php.general (#132956) next »