Doc #47084 [Com]: Calling mktime() w/o arguments raises strict error
| From: | niklas dot karlssonn at gmail dot com | Date: | Wed, 16 Nov 2011 10:49:40 +0000 |
| Subject: | Doc #47084 [Com]: Calling mktime() w/o arguments raises strict error | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7436@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=47084&edit=1
ID: 47084
Comment by: niklas dot karlssonn at gmail dot com
Reported by: tacker@php.net
Summary: Calling mktime() w/o arguments raises strict error
Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Irrelevant
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
The error message its not correct either, use the time() instead of mktime? The functions does not
return the same result, time() doesn't respect the timezone setting.
Previous Comments:
------------------------------------------------------------------------
[2011-05-26 02:39:25] pansit at yahoo dot com dot ph
I would like to ask (as this has been brought up from pear but no answer was made), why is time()
recommended to use than gmmktime()?
I'm using PHP 5.3.6 with strict on and I got this message:
Strict Standards: gmmktime() [function.gmmktime.html]: You should be using the time() function
instead
------------------------------------------------------------------------
[2009-08-01 12:05:53] salathe@php.net
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.
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=47084&edit=1