Skip to content

InvalidCast

An explicit cast can never succeed for the given type.

<?php
/** @param array $data */
function process(array $data): int {
return (int) $data; // casting array to int is always 1 or 0, never meaningful
}

Use an appropriate conversion function or remove the unnecessary cast.