Type mixed can only be used as a standalone type

Description

mixed is a special type, that represents all the available types. There is no need to combine this type in an union, as all the types are already compiled in mixed; Nor it can be combined in an intersectional type.

Example

<?php

function foo(A|mixed $i = null) {}

?>

Solutions

  • Remove the mixed type and use other types.

  • Remove the mixed type entirely.