Check if PHP function returns null or nothing

php, return-value

Solution

It's not possible. When no return value is set the function automatically returns null.

Problem

I have this code ``` $return = $ep->$method($params); if ($return === null) { throw new Exception('Endpoint has no return value'); } return $return; ``` Is there any way to distinguish between a method that returns `null` and a method that does not return anything?

Original source