> Le 5 oct. 2022 à 06:46, Eugene Sidelnyk <zsidel...@gmail.com> a écrit : > > I assume the behavior should be the same as if we called the function > having respective parameter type-hint (with a remark that strict types are > disabled):
Hi, Function parameters are more restrictive than explicit cast in what it accepts. In particular, the following inputs are rejected with a TypeError when fed to a function that accepts an `int`: `"3 mices"`, `null`, `[ ]`. Most notably, no type conversion is performed when the input type is `null` or `array`, or when the target type is `array` or `object`. For reference, the original conversion rules are here: https://wiki.php.net/rfc/union_types_v2#coercive_typing_mode <https://wiki.php.net/rfc/union_types_v2#coercive_typing_mode> (I don’t know if there has been adjustments since then.) —Claude