Bug #78509 [NEW]: Calling time() with parameter(s) returns NULL

From: Date: Sat, 07 Sep 2019 12:25:24 +0000
Subject: Bug #78509 [NEW]: Calling time() with parameter(s) returns NULL
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222620@lists.php.net to get a copy of this message
From: gvre at gvre dot gr Operating system: Linux PHP version: 7.3Git-2019-09-07 (Git) Package: Date/time related Bug Type: Bug Bug description:Calling time() with parameter(s) returns NULL Description: ------------ Calling the "time()" function with a parameter works fine in PHP <= 7.2.x and returns an int. In PHP 7.3, it returns NULL and produces a "Warning: time() expects exactly 0 parameters, 1 given" message instead. https://3v4l.org/OT21N https://github.com/php/php-src/blob/php-7.3.0/ext/date/php_date.c#L1775 I know that passing a parameter to time() is wrong, but I think it could produce a warning and return the value in PHP 7.3 (and 7.4 maybe), since it works fine in 7.2 and is common in C to call it that way. I did not find anything related to deprecation pages, so it may be useful to document this behavior as deprecated in case you decide to keep it as is. Test script: --------------- <?php var_dump(time(null)); Expected result: ---------------- The current Unix timestamp. Actual result: -------------- NULL -- Edit bug report at https://bugs.php.net/bug.php?id=78509&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=78509&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78509&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78509&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78509&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78509&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78509&r=support Expected behavior: https://bugs.php.net/fix.php?id=78509&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78509&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78509&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78509&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=78509&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=78509&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78509&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78509&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78509&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78509&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78509&r=mysqlcfg

« previous php.bugs (#222620) next »