Doc #54932 [NEW]: gmmktime issues strict standard warning
| From: | pansit at yahoo dot com dot ph | Date: | Thu, 26 May 2011 01:31:35 +0000 |
| Subject: | Doc #54932 [NEW]: gmmktime issues strict standard warning | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-6661@lists.php.net to get a copy of this message | ||
From:
Operating system: Windows XP
PHP version: 5.3.6
Package: Unknown/Other Function
Bug Type: Documentation Problem
Bug description:gmmktime issues strict standard warning
Description:
------------
A similar problem has been reported and added to the documentation for the
use of mktime() without parameters.
Similar thing for gmmktime() when called without parameter generates this
strict standard error:
Strict Standards: gmmktime() [function.gmmktime.html]: You should be using
the time() function instead
Untested on other system or other version other than the one I specified in
this bug report.
Query: Why is time() a more appropriate function to use than gmmktime()
even if both would have no parameters?
Upon reading the documentation for mktime() this may have something to do
with timezone, though not fully explained. So I added this line before the
function:
date_default_timezone_set ('UTC');
also tried it with:
date_default_timezone_set ('Asia/Manila');
It still does the same and also tested it with mktime()
Excerpt from http://www.php.net/manual/en/function.mktime.php:
"Every call to a date/time function will generate a E_NOTICE if the time
zone is not valid, and/or a E_STRICT or E_WARNING message if using the
system settings or the TZ environment variable. See also
date_default_timezone_set()"
It's not fully documented as to why invalidating a timezone would present
less impact than using a valid TZ environment variable.
Test script:
---------------
gmmktime();
--
Edit bug report at http://bugs.php.net/bug.php?id=54932&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54932&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54932&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54932&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54932&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54932&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54932&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54932&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54932&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54932&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54932&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54932&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54932&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54932&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54932&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54932&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54932&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54932&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54932&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54932&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54932&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54932&r=mysqlcfg