PHPreturn statements are not used in functions. The alternative usage of the PHPreturn statement is not only to share the role of the PHPreturn statement in the function, but also to see a wonderful usage method in the bbPress code. I always thought that the return statement can only be an alternative use of PHP return statements, not just in functions.
Share Another role of the PHP return statement, which is a wonderful way to use in the bbPress code.
I always thought that return can only appear in the function until I read the bbPress code:
Require_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 ');
} // Www.jb51.net
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.
Http://www.bkjia.com/PHPjc/880147.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/880147.htmlTechArticlePHP return statement alternative usage is not only in the function to share the PHP return statement of another role, in the bbPress code to see a wonderful way to use. Always thought that return can only be...