Bug #79382 [Opn->Csd]: Cannot redeclare disabled function
| From: | nikic@php.net | Date: | Thu, 30 Apr 2020 07:54:50 +0000 |
| Subject: | Bug #79382 [Opn->Csd]: Cannot redeclare disabled function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-226842@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79382&edit=1
ID: 79382
Updated by: nikic@php.net
Reported by: admin at franceserv dot fr
Summary: Cannot redeclare disabled function
-Status: Open
+Status: Closed
Type: Bug
Package: *General Issues
Operating System: Linux
PHP Version: 7.3.15 and 7.4
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Fixed in PHP 8 by https://github.com/php/php-src/commit/53eee290b6f5ca531aef19885a392c939013ce36.
It will now be possible to redefine disabled functions.
Previous Comments:
------------------------------------------------------------------------
[2020-04-27 12:13:53] nikic@php.net
The following pull request has been associated:
Patch Name: Completely remove disabled functions
On GitHub: https://github.com/php/php-src/pull/5473
Patch: https://github.com/php/php-src/pull/5473.patch
------------------------------------------------------------------------
[2020-03-17 12:32:41] bugreports at gmail dot com
> It seems to me that function_exists() should return true,
> even if the function is disabled
only if you provide a dedicated function or trow exceptions when disabled functions are called
because otherwise you can't write any code which handles the situation correctly
------------------------------------------------------------------------
[2020-03-17 12:07:15] cmb@php.net
It seems to me that function_exists() should return true, even if
the function is disabled.
------------------------------------------------------------------------
[2020-03-17 09:16:39] nikic@php.net
This is a pretty interesting case. I'm not sure what the correct behavior for this is.
Should we be allowing redefinition of disabled functions? Might be rather problematic technically.
Things would be a lot clearer here if disabled functions were simply completely removed, rather than
replaced with a dummy implementation.
------------------------------------------------------------------------
[2020-03-14 14:27:14] bugreports at gmail dot com
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()
{
}
}
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=79382
--
Edit this bug report at https://bugs.php.net/bug.php?id=79382&edit=1