Is there a difference between:
function someMethod( $someArg ) {
// some code
return;
}
and
function someMethod( $someArg ) {
// some code
// no return
}
Both have NULL
as 'return value'. Is there a difference? Something PHP internally? Performance? Speed?
edit
I ask, because in Zend framework (in this video) they use return;
which seemed (seems) silly to me. However, you would think that the people behind Zend framework do know their PHP...
php code
<?php
function a() {
echo 1;
return;
}
function b() {
echo 2;
}
generated bytecode
.FUNCTION a
ECHO 1
RETURN NULL
RETURN NULL
HANDLE_EXCEPTION
.END FUNCTION
.FUNCTION b
ECHO 2
RETURN NULL
HANDLE_EXCEPTION
.END FUNCTION
so the explicit return statement generates one extra RETURN instruction. Otherwise there's no difference.