Bug #80394 [Opn->Fbk]: Fatal error when using cakephp/chronos with preload
Edit report at https://bugs.php.net/bug.php?id=80394&edit=1
ID: 80394
Updated by: nikic@php.net
Reported by: dsechgh at gmail dot com
Summary: Fatal error when using cakephp/chronos with preload
-Status: Open
+Status: Feedback
Type: Bug
Package: opcache
Operating System: docker/debian/alpine
PHP Version: 7.4.12
Block user comment: N
Private report: N
New Comment:
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).
Previous Comments:
------------------------------------------------------------------------
[2020-11-20 22:30:23] 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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80394&edit=1
Thread (3 messages)