|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-17 12:39 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 22:00:02 2025 UTC |
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