php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72698 Function started giving "expected to be a reference, value given"
Submitted: 2016-07-28 07:58 UTC Modified: 2016-07-28 16:54 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: daniel dot k at siteground dot com Assigned: nikic (profile)
Status: Closed Package: Variables related
PHP Version: 7.0.9 OS: CentOS
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: daniel dot k at siteground dot com
New email:
PHP Version: OS:

 

 [2016-07-28 07:58 UTC] daniel dot k at siteground dot com
Description:
------------
After an upgrade from PHP 7.0.8 to 7.0.9 several sites hosted on our infrastructure stopped working. One of the sites is a WordPress site which uses a plugin called W3 Total Cache. The plugin works just fine with PHP 7.0.8 and when PHP 7.0.9 is used the site just gives a blank page. The entries in the logs are:

Warning: Parameter 1 to W3_Plugin_Minify::ob_callback() expected to be a reference, value given in /wp-content/plugins/w3-total-cache/inc/functions/plugin.php on line 23
Warning: Parameter 1 to W3_Plugin_Cdn::ob_callback() expected to be a reference, value given in /wp-content/plugins/w3-total-cache/inc/functions/plugin.php on line 23
Warning: Parameter 1 to W3_PgCache::ob_callback() expected to be a reference, value given in /wp-content/plugins/w3-total-cache/inc/functions/plugin.php on line 23
Warning: Parameter 1 to W3_Plugin_Minify::ob_callback() expected to be a reference, value given in /wp-content/plugins/w3-total-cache/inc/functions/plugin.php on line 23
Warning: Parameter 1 to W3_Plugin_Cdn::ob_callback() expected to be a reference, value given in /wp-content/plugins/w3-total-cache/inc/functions/plugin.php on line 23
Warning: Parameter 1 to W3_PgCache::ob_callback() expected to be a reference, value given in /wp-content/plugins/w3-total-cache/inc/functions/plugin.php on line 23
Warning: Parameter 1 to W3_Plugin_Minify::ob_callback() expected to be a reference, value given in /wp-content/plugins/w3-total-cache/inc/functions/plugin.php on line 23
Warning: Parameter 1 to W3_Plugin_Cdn::ob_callback() expected to be a reference, value given in /wp-content/plugins/w3-total-cache/inc/functions/plugin.php on line 23
Warning: Parameter 1 to W3_PgCache::ob_callback() expected to be a reference, value given in /wp-content/plugins/w3-total-cache/inc/functions/plugin.php on line 23

The issue and the solution are also explained in this blog post:

https://www.itnota.com/fixing-php7-compatibility-issue-w3-total-cache/

Other applications such as vBulletin and Joomla! are also experiencing similar issues.

The question here is why 7.0.9 causes the sites to go down and the same code works with 7.0.8.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-28 08:06 UTC] daniel dot k at siteground dot com
I forgot to mentioned that we tested the latest commits from Github and the issue is still present with 7.0.9.
 [2016-07-28 09:49 UTC] cmb@php.net
-Assigned To: +Assigned To: nikic
 [2016-07-28 09:49 UTC] cmb@php.net
It seems to me that's caused by
<https://github.com/php/php-src/commit/fafe01b>.

Shouldn't we add info about that in NEWS and/or UPGRADING, Nikita?
 [2016-07-28 16:54 UTC] nikic@php.net
-Status: Assigned +Status: Closed
 [2016-07-28 16:54 UTC] nikic@php.net
In the interest of backwards compatibility I've reverted the commit from PHP-7.0: https://github.com/php/php-src/commit/3b48c5a36f7f903ecf206ff5c46a125f7edfee49

Additionally, I've added an UPGRADING note for PHP-7.1: https://github.com/php/php-src/commit/1315a3dd620926ba1f57eccb3081ab7c64d7a31f
 [2016-07-29 06:28 UTC] daniel dot k at siteground dot com
Thank you for the assistance. We created our own 7.0.9 package without the commits in question and all sites started working as expected.

On a side note, I thought minor releases are not supposed to break the backwards compatibility but obviously sometimes such commits are missed until hundreds of sites are affected :)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 03:01:27 2024 UTC