doFoo($arrayOfFoo, 'Success'); // Success echo $myBar->doFoo($notArrayOfFoo, 'Success'); // Uncaught TypeError: Argument 2 passed to Bar::{closure}() must be an instance of Foo, instance of NotFoo given...