|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-03-13 23:11 UTC] admin at franceserv dot fr
Description:
------------
Hello,
Several websites are affected (Wordpress, NextCloud, PMB, Phpbb etc ...) on PHP 7.3.x till this version (7.3.15) and same with PHP 7.4 till now since several month.
The problem isn't present with PHP 7.2.x and lower.
The affected function is : if (!function_exists('getallheaders'))
With PHP 7.3 and 7.4 the following error is reported :
Fatal error: Cannot redeclare getallheaders() in ...
With exactly the same website without modification files the problem is not present on PHP 7.2 and lower.
Sample error message on PHP 7.3 and 7.4 :
Nextcloud : Fatal error: Cannot redeclare getallheaders() in /home/httpd/*/*/*/*/*/3rdparty/ralouphie/getallheaders/src/getallheaders.php on line 10
PhpBB : /home/httpd/*/*/*/*/*/forum/vendor/ralouphie/getallheaders/src/getallheaders.php on line 10
PMB : /home/httpd/*/*/*/*/*/includes/apache_functions.inc.php on line 10
Wordpress etc ...
All web developers are saying to rename the function "function getallheaders()" to avoid this error message ... which is not possible to everybody which are not developers ...
I'm using PHP 7.2, 7.3 and 7.4 on PHP-FPM with compilation install.
Someone could solve this problem which become more visible since people are upgrading their website to PHP 7.3 and + ?
Thank you in advance.
Actual result:
--------------
Fatal error: Cannot redeclare getallheaders() in ...
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 16 04:00:02 2025 UTC |
"disable_functions" should throw an exception when a disabled function is called so one can handle it proper without spread *slow and expensive* function exists into the codebase - try/catch is much faster in cases where it don't throw such compat layers defining a function which is part of a newer php release should go into a include file because code like below would be completly optimized out by opcache given the constant nature known at "compile time" if(PHP_VERSION_ID < 70300) { require 'php73.inc.php'; }that would also work better if you don't want a seperated include file which could be thrown away all togehter after deciding no longer support anything below PHP 7.3 on newer php versions this would also optimized out completly and avoid the issue of that bugreport as well as the terrible runtime overhead of function_exists() if(PHP_VERSION_ID < 70300)) { function getallheaders() { } }