The previous rules refected PHP-5 behavior and were completely wrong for PHP-7. (e.g. scalars don't have reference counters at all).
This change shouldn't affect anything, because results of this inference are not used yet.
Instead decide whether a function returned by reference or by value
by checking whether the return value has REFERENCE type. This means
that functions returning by reference must always return a reference
and functions returning by value must not return a reference.