#36988 [Opn->Asn]: mktime freezes on long numbers
| From: | derick@php.net | Date: | Wed, 05 Apr 2006 19:00:04 +0000 |
| Subject: | #36988 [Opn->Asn]: mktime freezes on long numbers | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-95359@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: Open
+Status: Assigned
Bug Type: Date/time related
Operating System: Linux, FreeBSD
PHP Version: 5.1.2
-Assigned To:
+Assigned To: derick
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