What's the difference between TypeError and InvalidArgumentException in PHP 7?
When to throw TypeError and when to throw InvalidArgumentException?
It seems that the error is getting more like exception in PHP 7.
What's the border line that divides error and exception?
TypeError
is what mean the condition occurs when:
InvalidArgumentException
is the exception thrown if an argument is not of the expected type.
Errors can be handled at runtime by catching \Throwable
.