Jump to content
  • Hello visitors, welcome to the Hacker World Forum!

    Red Team 1949  (formerly CHT Attack and Defense Team) In this rapidly changing Internet era, we maintain our original intention and create the best community to jointly exchange network technologies. You can obtain hacker attack and defense skills and knowledge in the forum, or you can join our Telegram communication group to discuss and communicate in real time. All kinds of advertisements are prohibited in the forum. Please register as a registered user to check our usage and privacy policy. Thank you for your cooperation.

    TheHackerWorld Official

php中return与return false区别?能举个项目常用的例子吗?

 Share


Recommended Posts

php中return与return false区别?能举个项目常用的例子吗?_百度知道  https://zhidao.baidu.com/question/1767458165083536020.html is8888
2014-11-22 · TA获得超过691个赞 知道小有建树答主 wise.1.14d70dc0.unt5qHEWAeUBVvp1HmTn0g.j 回答量:530 采纳率:0% 帮助的人:424万 我也去答题访问个人页 关注 return表示退出执行,即结束一个函数的执行,这个时候事实上可以理解返回的是空值(void),如果你了解java的话就很清楚了,在java里面,如果一个函数没有返回值,那么返回的就是void。但是php是弱类型语言,并没有强制限定,也没有提供void关键字,且定义的函数可以返回多中类型的值。
return false就简单了,返回的是一个boolean结果,通常用于进行一些判断。
当然,如果返回值你并没有使用,return void的时候你也可以使用return false,即,如果一个函数只是执行一些操作,但是你并不需要返回的结果,直接使用return和return false、return true都是可以的,这个时候其实重点在return上,用于结束函数的执行。
例子就不提供了吧,很简单的。
Link to post
Link to comment
Share on other sites

 Share

discussion group

discussion group

    You don't have permission to chat.
    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...