InvalidCast
An explicit cast can never succeed for the given type.
Example
Section titled “Example”<?php/** @param array $data */function process(array $data): int { return (int) $data; // casting array to int is always 1 or 0, never meaningful}How to fix
Section titled “How to fix”Use an appropriate conversion function or remove the unnecessary cast.