#47084 [Opn->Csd]: Calling mktime() w/o arguments raises strict error
ID: 47084
Updated by: salathe@php.net
Reported By: tacker@php.net
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: Irrelevant
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
I have added a note and changelog to the mktime page to inform of the
E_STRICT when called with no arguments, making reference to use time()
instead.
apradhan at sampatti dot com: that is intended behaviour. There are
only 30 days in June, so by using 31 as the $day argument it rolls over
to the first of July.
Previous Comments:
------------------------------------------------------------------------
[2009-08-01 12:01:15] svn@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&revision=286620
Log: Fixes #47084 Document mktime() E_STRICT with no arguments
------------------------------------------------------------------------
[2009-08-01 06:14:38] apradhan at sampatti dot com
I have seen a issue in mktime() for the date of 31 july
like if we write
echo date("m",mktime(0,0,0,07-1,31, 2009));
Above code will give output : 07
while logically it should be 6.
------------------------------------------------------------------------
[2009-01-13 10:25:20] tacker@php.net
Description:
------------
This code below will generate a strict error.
Also the documentation
a) states that mktime() can be called w/o arguments
int mktime ([ int $Stunde [, int $Minute [, int $Sekunde [, int
$Monat [, int $Tag [, int $Jahr [, int $is_dst ]]]]]]] )
b) does not recommend using time() instead of mktime()
Reproduce code:
---------------
<?php
mktime();
?>
Actual result:
--------------
Strict standards: mktime(): You should be using the time() function
instead
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47084&edit=1
Thread (6 messages)