OK,  perhaps add a comment in the code then as it looks confusing.

Return_value comes in through the PHP_FUNCTION macro.