Doc #47084 [Com]: Calling mktime() w/o arguments raises strict error
| From: | pansit at yahoo dot com dot ph | Date: | Thu, 26 May 2011 00:39:29 +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-6660@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=47084&edit=1
ID: 47084
Comment by: pansit at yahoo dot com dot ph
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:
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
Previous Comments:
------------------------------------------------------------------------
[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 http://bugs.php.net/bug.php?id=47084&edit=1