This article mainly introduces another function of the PHPreturn statement. one of the wonderful usage methods seen in the bbPress code can be referenced by friends who have always thought that return can only appear in the function, after reading the bbPress code:
<? Phprequire_once ('./bb-load.php'); bb_repermalink (); // The magic happens here. if ($ self) {if (strpos ($ self, '. php ')! = False) {require ($ self);} else {require (BB_PATH. 'Profile-base. php');} return ;}
Can return still appear outside of the function? This is unimaginable in the C language.
Check the PHP Manual: if a return statement is called in a function, the execution of the function is immediately ended and its parameters are returned as the function value. If it is called globally, the current script file stops running.
Alas, the C language is too poisonous.