php.net |  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
8 + 14 = ?
Subscribe to this entry?

 
 [2020-11-20 22:30 UTC] dsechgh at gmail dot com
Description:
------------
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
<?php

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


// index.php
<?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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-24 14:00 UTC] nikic@php.net
-Status: Open +Status: Feedback
 [2020-11-24 14:00 UTC] nikic@php.net
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-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 05:01:27 2025 UTC