|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80394 Fatal error when using cakephp/chronos with preload
Submitted: 2020-11-20 22:30 UTC Modified: 2020-12-02 09:01 UTC
From: dsechgh at gmail dot com Assigned:
Status: Closed Package: opcache
PHP Version: 7.4.12 OS: docker/debian/alpine
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: dsechgh at gmail dot com
New email:
PHP Version: OS:


 [2020-11-20 22:30 UTC] dsechgh at gmail dot com
When trying to instantiate a Chronos object and preload is enabled, there seems to be a nonsensical fatal error. This happens since php7.4.12, previous php7.4 versions don't have this issue.

To reproduce:
> composer require cakephp/chronos:2.0.6
> php -dopcache.enable_cli=1 -dopcache.preload=preload.php index.php
Fatal error: Only variables can be passed by reference in /var/www/html/index.php on line 5

In case this is relevant - I used the official php docker images + opcache module, and composer version 2.0.7

Test script:
// preload.php

require __DIR__ . '/vendor/autoload.php';

// index.php

require __DIR__ . '/vendor/autoload.php';

$date = Cake\Chronos\Chronos::createFromFormat(DATE_RFC3339_EXTENDED, '2020-11-20T21:00:00.000Z');

Expected result:
-- no error

Actual result:
Fatal error: Only variables can be passed by reference in /var/www/html/index.php on line 5


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-24 14:00 UTC]
-Status: Open +Status: Feedback
 [2020-11-24 14:00 UTC]
PHP 7.4.12 has a known preloading bug affecting many projects. It should be resolved with PHP 7.4.13, which will be released later this week. Please tell me if problems persist with that release (temporarily downgrading to 7.4.11 should also avoid the issue).
 [2020-12-02 09:01 UTC] dsechgh at gmail dot com
-Status: Feedback +Status: Closed
 [2020-12-02 09:01 UTC] dsechgh at gmail dot com
Can confirm the issue is solved in php7.4.13

Thank you for your amazing work and apologies for not seeing that there is a common issue with preloading in php7.4.12 before opening this bug report.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 09 19:01:27 2023 UTC