RE: [PHP] Found a PHP bug!!!!!!!!!

From: Date: Mon, 27 Jan 2003 19:53:14 +0000
Subject: RE: [PHP] Found a PHP bug!!!!!!!!!
Groups: php.general 
Request: Send a blank email to php-general+get-133282@lists.php.net to get a copy of this message
> -----Original Message----- > From: Scott Fletcher [mailto:scott@abcoa.com] > > Found a PHP bug, I'm using PHP version 4.2.3. I have been > struggling with > why PHP code failed to work with the month is August or > September I stumbled into this one a short while ago myself. It is not a bug, but a feature! ;) When passing values of 08 or 09 (Aug and Sep), PHP interprets them as octal numbers (because of the leading 0). However, 08 and 09 are invalid octal numbers, so PHP converts them to zero. The fixes are numerous: - remove the leading zero; - add zero to them before passing (addition forces a type conversion to int); - force a type conversion to integer using (int); - quote them (when PHP converts a string to an integer, it removes the leading zero); Kirk

« previous php.general (#133282) next »