InvalidArgumentException¶
Exception thrown if an argument is not of the expected type. It is a LogicException, and it may be thrown when using SPL classes.
<?php
function foo(string $a) {}
// OK
foo("abc");
// KO : invalid argument
foo(12);
?>
Related : LogicException