When inferring types within a function, those should be used to compute the type signature of the function. For example
<?php
function foo($foo) {
return $foo + 2;
}
gives the error
Notice: Type mismatch: expected: Numeric, found: Any
return $foo + 2;
However, the type inferencer should detect that in this case foo receives a numeric argument and enforce it later.