#36988 [Asn->Csd]: mktime freezes on long numbers
| From: | derick@php.net | Date: | Tue, 11 Apr 2006 18:03:47 +0000 |
| Subject: | #36988 [Asn->Csd]: mktime freezes on long numbers | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-95624@lists.php.net to get a copy of this message | ||
ID: 36988
Updated by: derick@php.net
Reported By: virtuall at virtuall dot info
-Status: Assigned
+Status: Closed
Bug Type: Date/time related
Operating System: Linux, FreeBSD
PHP Version: 5.1.2
Assigned To: derick
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-04-05 18:24:30] virtuall at virtuall dot info
Description:
------------
I believe it's not a bug, but it's a really good way to lock down the
server for a couple of seconds.
Anyway, mktime does not check if 'year' is a valid number. It accepts
any integer value and starts counting the seconds.
IMO mktime should have some limit after which the date is considered
invalid and it returns FALSE without even starting to count.
Reproduce code:
---------------
<?php
$start = microtime(1);
$a = mktime(1, 1, 1, 1, 1, 11111111111);
var_dump($a);
echo number_format(microtime(1) - $start, 2)."\n";
?>
Expected result:
----------------
bool(false)
0.00
Actual result:
--------------
bool(false)
44.57
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36988&edit=1