Bug #78267 [NEW]: Change in sun times result with PHP version change

From: Date: Tue, 09 Jul 2019 19:34:57 +0000
Subject: Bug #78267 [NEW]: Change in sun times result with PHP version change
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221672@lists.php.net to get a copy of this message
From: stefano dot borghi at gmx dot com Operating system: PHP version: 7.2.20 Package: Date/time related Bug Type: Bug Bug description:Change in sun times result with PHP version change Description: ------------ In PHP >= v7.2 the result of the date_sun_info function, and similarly the other sun related functions, return a different value for sunrise and sunset compared to the previous PHP versions. I'm not sure if this is an expected change due to a correction of a previously wrong result or if it's an actual bug. In any case this change is not reported in the documentation. Test script: --------------- // see https://3v4l.org/31aER function sunTimes($lat, $long, $date) { date_default_timezone_set('UTC'); $sun_info = date_sun_info(strtotime($date), $lat, $long); $sunrise = date("H:i:s", $sun_info['sunrise']); $sunset = date("H:i:s", $sun_info['sunset']); return "on $date sun rises at $sunrise and sets at $sunset"; } echo sunTimes(51.5, 0, '2018-03-14'); // ~London Expected result: ---------------- // PHP <= v7.1.0 'on 2018-03-14 sun rises at 06:14:51 and sets at 18:03:16' Actual result: -------------- // PHP >= v7.2.4 'on 2018-03-14 sun rises at 06:15:59 and sets at 18:02:24' -- Edit bug report at https://bugs.php.net/bug.php?id=78267&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=78267&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=78267&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=78267&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=78267&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78267&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78267&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78267&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78267&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78267&r=support Expected behavior: https://bugs.php.net/fix.php?id=78267&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78267&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78267&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78267&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78267&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=78267&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78267&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78267&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78267&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78267&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78267&r=mysqlcfg

« previous php.bugs (#221672) next »