Skip to content

Commit de03bc8

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fixed bug #80781
2 parents fd3692b + ed4f90f commit de03bc8

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Zend/tests/bug80781.phpt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
Bug #80781: Error handler that throws ErrorException infinite loop
3+
--FILE--
4+
<?php
5+
6+
function handle(int $severity, string $message, string $file, int $line): bool {
7+
if((error_reporting() & $severity) !== 0) {
8+
throw new \ErrorException($message, 0, $severity, $file, $line);
9+
}
10+
11+
return true; // stfu operator
12+
}
13+
14+
set_error_handler('handle');
15+
16+
function getPlugin(string $plugin) : bool{
17+
return false;
18+
}
19+
20+
$data = [];
21+
$array = [];
22+
if (isset($array[$data]) or getPlugin($data)) {
23+
24+
}
25+
26+
?>
27+
--EXPECTF--
28+
Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in %s:%d
29+
Stack trace:
30+
#0 {main}
31+
thrown in %s on line %d

0 commit comments

Comments
 (0)