Skip to content

InvalidArgument

An argument’s type does not match the parameter’s declared type.

<?php
function double(int $n): int { return $n * 2; }
double('five'); // string passed, int expected

Pass a value of the correct type or widen the parameter type.