|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80781 Error handler that throws ErrorException infinite loop
Submitted: 2021-02-22 00:58 UTC Modified: -
Avg. Score:2.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dktapps at pmmp dot io Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 7.4.15 OS: Windows 10
Private report: No CVE-ID: None
 [2021-02-22 00:58 UTC] dktapps at pmmp dot io
This bug seems to be specific to 7.4 and upwards: it doesn't reproduce on 7.3 and below, as seen here:

The following code results in an infinite loop on Windows and a segmentation fault on Linux.

Test script:


function handle(int $severity, string $message, string $file, int $line) : bool{
	if((error_reporting() & $severity) !== 0){
		throw new \ErrorException($message, 0, $severity, $file, $line);

	return true; //stfu operator

function getPlugin(string $plugin) : bool{
	return false;
$data = [];
$array = [];
if(isset($array[$data]) or getPlugin($data)){


Expected result:
Something like the following:

Fatal error: Uncaught ErrorException: Illegal offset type in isset or empty in /in/EpP2L:19
Stack trace:
#0 /in/EpP2L(19): handle(2, 'Illegal offset ...', '/in/EpP2L', 19, Array)
#1 {main}
  thrown in /in/EpP2L on line 19

Actual result:
An infinite loop occurs on Windows.
Judging by the exit code on 3v4l, it appears this script causes a segfault on Unix.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-02-22 08:38 UTC]
Automatic comment on behalf of
Log: Fixed bug #80781
 [2021-02-22 08:38 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 23:01:29 2024 UTC