Skip to content

Commit

Permalink
Merge branch 'PHP-8.0'
Browse files Browse the repository at this point in the history
* PHP-8.0:
  Fixed bug #80781
  • Loading branch information
nikic committed Feb 22, 2021
2 parents fd3692b + ed4f90f commit de03bc8
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Zend/tests/bug80781.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--TEST--
Bug #80781: Error handler that throws ErrorException infinite loop
--FILE--
<?php

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
}

set_error_handler('handle');

function getPlugin(string $plugin) : bool{
return false;
}

$data = [];
$array = [];
if (isset($array[$data]) or getPlugin($data)) {

}

?>
--EXPECTF--
Fatal error: Uncaught TypeError: Illegal offset type in isset or empty in %s:%d
Stack trace:
#0 {main}
thrown in %s on line %d

0 comments on commit de03bc8

Please sign in to comment.