<?php
set_error_handler(function () {});
//error_reporting(0); // Yeah, not the best solution
class SomeClass {}
function test(SomeClass $instance) { var_dump($instance); }
test(1);
test('Really?');
test(fopen('/tmp/someshit'));
test(9.999);
Fatal error: Uncaught TypeError: test(): Argument #1 ($instance) must be of type SomeClass, int given, called in /in/HDBt9 on line 12 and defined in /in/HDBt9:10
Stack trace:
#0 /in/HDBt9(12): test(1)
#1 {main}
thrown in /in/HDBt9 on line 10
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of SomeClass, int given, called in /in/HDBt9 on line 12 and defined in /in/HDBt9:10
Stack trace:
#0 /in/HDBt9(12): test(1)
#1 {main}
thrown in /in/HDBt9 on line 10
Process exited with code 255.
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of SomeClass, integer given, called in /in/HDBt9 on line 12 and defined in /in/HDBt9:10
Stack trace:
#0 /in/HDBt9(12): test(1)
#1 {main}
thrown in /in/HDBt9 on line 10
Process exited with code 255.