#30132 [Opn->Bgs]: 08 and 09 become 0 when passed to function, 07..00 become 7..0
| From: | derick@php.net | Date: | Fri, 17 Sep 2004 10:40:05 +0000 |
| Subject: | #30132 [Opn->Bgs]: 08 and 09 become 0 when passed to function, 07..00 become 7..0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66342@lists.php.net to get a copy of this message | ||
ID: 30132
Updated by: derick@php.net
Reported By: troy dot martin at comcast dot net
-Status: Open
+Status: Bogus
Bug Type: Variables related
Operating System: Windows 2000 Sp 4
PHP Version: 5.0.1
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
Octal numbers -> RTM
Previous Comments:
------------------------------------------------------------------------
[2004-09-17 12:35:16] troy dot martin at comcast dot net
Description:
------------
When I pass 09 or 08 to a function, the leading zero remains, but the 9
or 8 is dropped. Consequently, the value becomes 0.
When I pass 07, 06, 05, 04, 03, 02, 01, or 00, the leading zero is
dropped, and the value remains as it should.
Reproduce code:
---------------
function convertTimeToSeconds($hours, $minutes, $seconds, $hundreths)
{
print "\$minutes: " . $minutes . "<br>\n";
print $hours . ":" . $minutes . ":" . $seconds . ":" . $hundreths .
" = ";
$seconds += $hours * 3600;
$seconds += $minutes * 60;
$seconds += $hundreths / 100;
print $seconds . " seconds" . "<br>\n";
return $seconds;
}
convertTimeToSeconds(00, 09, 54, 00);
convertTimeToSeconds(00, 08, 54, 00);
convertTimeToSeconds(00, 07, 54, 00);
convertTimeToSeconds(00, 06, 54, 00);
Expected result:
----------------
I expect the 09 and 08 values to change to 9 and 8 respectively. They
are changed to 0 instead.
Actual result:
--------------
09 and 08 become 0
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30132&edit=1