1--TEST-- 2#[\Deprecated]: Throwing error handler does not leak parameters. 3--FILE-- 4<?php 5 6set_error_handler(function (int $errno, string $errstr, ?string $errfile = null, ?int $errline = null) { 7 throw new \ErrorException($errstr, 0, $errno, $errfile, $errline); 8}); 9 10#[Deprecated] 11function test($dummy) {} 12 13try { 14 $x = test(new stdClass()); 15} catch (ErrorException $e) { 16 echo "Caught: ", $e->getMessage(), PHP_EOL; 17} 18 19?> 20--EXPECT-- 21Caught: Function test() is deprecated 22