InvalidArgument
An argument’s type does not match the parameter’s declared type.
Example
Section titled “Example”<?phpfunction double(int $n): int { return $n * 2; }
double('five'); // string passed, int expectedHow to fix
Section titled “How to fix”Pass a value of the correct type or widen the parameter type.