Bug #77854 [Opn]: DateTime object comparison wrong

From: Date: Wed, 10 Apr 2019 21:54:03 +0000
Subject: Bug #77854 [Opn]: DateTime object comparison wrong
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220393@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77854&edit=1 ID: 77854 Updated by: derick@php.net Reported by: Stephan dot Hartmann at flyeralarm dot com Summary: DateTime object comparison wrong Status: Open Type: Bug Package: Date/time related Operating System: Ubuntu PHP Version: 7.1.28 Block user comment: N Private report: N New Comment: (built: Mar 0 2019 03:44:52) Mar 0? That's... peculiar. Previous Comments: ------------------------------------------------------------------------ [2019-04-10 12:35:15] Stephan dot Hartmann at flyeralarm dot com https://github.com/Talarion291/phpalpinebug check this out for minimal example ------------------------------------------------------------------------ [2019-04-08 14:09:40] Stephan dot Hartmann at flyeralarm dot com Using the php:7.1.27-cli-stretch image from dockerhub passes the testscript. Using the php:7.1.28-cli-alpine image from dockerhub fails the testscript, hinting that the whole php:7.1.*-cli-alpine images are affected. ------------------------------------------------------------------------ [2019-04-08 08:00:22] Stephan dot Hartmann at flyeralarm dot com More precisely its the 4 week old PHP 7.1.27 (cli) (built: Mar 0 2019 03:44:52) php 7.1-cli-alpine e6492c17926d 4 weeks ago 70MB ------------------------------------------------------------------------ [2019-04-08 07:42:43] Stephan dot Hartmann at flyeralarm dot com After compiling 7.1.27 locally on my machine (Ubuntu 18.04.02) this minimal example passes, while on the current "php:7.1-cli-alpine" docker image from docker hub this minimal example fails. Please try to reproduce bug using said image. Additionally using $date = new DateTime('2019-04-05 12:34:56.123456'); passes both times, while using $date = new DateTime(); fails in docker image; ------------------------------------------------------------------------ [2019-04-05 16:37:51] requinix@php.net Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Using the current time is not repeatable. Please pick a specific time. PHP 7.1 is no longer in active support, but I can't reproduce this behavior with it anyways. https://3v4l.org/3vaor ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=77854 -- Edit this bug report at https://bugs.php.net/bug.php?id=77854&edit=1

« previous php.bugs (#220393) next »