Is it better to use require_once('filename.php') or require_once 'filename.php';

后端 未结 5 1811
遇见更好的自我
遇见更好的自我 2021-01-01 09:27

Is this just a stylistic difference, or does using require_once(\'filename.php\') vs require_once \'filename.php\' have actual load/efficiency diff

5条回答
  •  感情败类
    2021-01-01 09:56

    It's exactly the same thing. It's a matter of style.

    The parentheses may get in the way some times. For instance, this example from the manual doesn't do what you expect:

    if (include('vars.php') == 'OK') {
        echo 'OK';
    }
    

    See example #4.

提交回复
热议问题