Check if PHP function returns null or nothing
With PHP7’s return type declaration feature:
function a(): void {
return null; // :(
}
function b(): void {
// :)
}
function c(): void {
return; // :)
}
If the function doesn't return anything, then you should not test it's return value. You should know which functions are expected to return something or nothing at all - even if you're not the one who wrote them.
It's not possible. When no return value is set the function automatically returns null.