Bug #79647 [NEW]: Conflict between $GLOBALS["now"] and $now
From: murray at focus-computing dot com dot au
Operating system: All
PHP version: 7.3.18
Package: Scripting Engine problem
Bug Type: Bug
Bug description:Conflict between $GLOBALS["now"] and $now
Description:
------------
A value is assigned to $GLOBALS["now"], however this is removed when a
value is assigned to $now, as in the example below
Test script:
---------------
$GLOBALS["now"] = time();
print "Year is " . strftime("%Y", $GLOBALS["now"]) . "\n";
$now = new DateTime("now");
print "Year is " . strftime("%Y", $GLOBALS["now"]) . "\n";
Expected result:
----------------
Year is 2020
Year is 2020
Actual result:
--------------
Year is 2020
<br /> <b>Warning</b>: strftime() expects parameter 2 to be int, object
given in <b>[...][...]</b> on line <b>10</b><br /> Year is
--
Edit bug report at https://bugs.php.net/bug.php?id=79647&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79647&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79647&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79647&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79647&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79647&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79647&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79647&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79647&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79647&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79647&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79647&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79647&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79647&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79647&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79647&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79647&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79647&r=mysqlcfg
Thread (9 messages)
- murray at focus-computing dot com dot au
- Unknown Message