xref: /PHP-8.0/Zend/tests/bug80781.phpt (revision 6dd85f83)
1--TEST--
2Bug #80781: Error handler that throws ErrorException infinite loop
3--FILE--
4<?php
5
6function 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
14set_error_handler('handle');
15
16function getPlugin(string $plugin) : bool{
17	return false;
18}
19
20$data = [];
21$array = [];
22if (isset($array[$data]) or getPlugin($data)) {
23
24}
25
26?>
27--EXPECTF--
28Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in %s:%d
29Stack trace:
30#0 {main}
31  thrown in %s on line %d
32