[HttpFoundation] Response fixes

First commit is a better solution for #6471 and also fixes several phpdocs.
The second commit fixes the return types and handling of zero.