Does a simple `return` in a PHP function simply end the function prematurely?

前端 未结 5 1669
梦毁少年i
梦毁少年i 2021-02-14 00:43

I have just seen this

// Check to see if the request is a XHR call    
if (request::is_ajax())
{
  // Send the 403 header
  header(\'HTTP/1.1 403 Forbidden\');
          


        
5条回答
  •  既然无缘
    2021-02-14 01:23

    PHP is dynamically typed, so returning no value is equivalent to returning a null value in any type.

提交回复
热议问题