Bug #80376 [Opn]: last day of the month causes runway cpu usage
| From: | mav2287 at aol dot com | Date: | Tue, 17 Nov 2020 19:41:20 +0000 |
| Subject: | Bug #80376 [Opn]: last day of the month causes runway cpu usage | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230416@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80376&edit=1
ID: 80376
User updated by: mav2287 at aol dot com
Reported by: mav2287 at aol dot com
Summary: last day of the month causes runway cpu usage
Status: Open
Type: Bug
Package: Date/time related
Operating System: OS X 10.11.6 El Capitan
PHP Version: 7.4.12
Block user comment: N
Private report: N
New Comment:
In case it isn't clear when using the sample script once you execute "$newDate =
$date->modify('last day of this month');" PHP will hang. You will never get the
chance to go to the next step of the script and do "php > var_dump($newDate);" as the
object is never created,
Previous Comments:
------------------------------------------------------------------------
[2020-11-17 19:38:15] mav2287 at aol dot com
Description:
------------
As discovered and documented via the Mac Ports project ( see ticket url below ) php versions 7.3.23
& 7.4.11 and newer seem to create a process with runaway CPU usage when attempting to get the
last day of the month. This runaway process seems to continue indefinitely and consumes 100% cpu.
Orignal Mac Ports Ticket:
https://trac.macports.org/ticket/61351
Test script:
---------------
# php -a
Interactive shell
php > $date = new \DateTime();
php > $newDate = $date->modify('last day of this month');
php > var_dump($newDate);
Expected result:
----------------
creation of a DateTime object and a blinking cursor awaiting new command
Actual result:
--------------
PHP will hang indefinitely and the php process will consume 100% cpu until manually killed
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80376&edit=1