MIR0238
InvalidScalarArgument
Without declare(strict_types=1), PHP converts a scalar argument to the parameter’s scalar type
when it can, so the call works for some values (a numeric string for an int) and throws a
TypeError or loses data for others.
Example
Section titled “Example”<?phpfunction page(int $n): int { return $n; }function f(string $input): int { return page($input); }How to fix
Section titled “How to fix”Convert the value explicitly ((int) $input) after validating it, or change the parameter type.
