Skip to content

Commit

Permalink
Skip deprecated E_USER_ERROR trigger on PHP 8.4+
Browse files Browse the repository at this point in the history
  • Loading branch information
bobthecow committed Aug 13, 2024
1 parent bc35811 commit 0f5b0d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/Exception/ErrorExceptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getLevels()
[\E_DEPRECATED, 'Deprecated'],
[\E_USER_DEPRECATED, 'Deprecated'],
[\E_RECOVERABLE_ERROR, 'Recoverable fatal error'],
[0, 'Error'],
[0, 'Error'],
];
}

Expand All @@ -77,6 +77,10 @@ public function getLevels()
*/
public function testThrowExceptionAsErrorHandler($level, $type)
{
// if (\version_compare(\PHP_VERSION, '8.4', '>=') && $level === \E_USER_ERROR) {
// $this->markTestSkipped('Passing E_USER_ERROR to trigger_error() is deprecated since 8.4');
// }

\set_error_handler([ErrorException::class, 'throwException']);
try {
\trigger_error('{whot}', $level);
Expand Down

0 comments on commit 0f5b0d4

Please sign in to comment.