1

I'm a newbie in PHP. I'm analyzing an existing source code and found this.

// this is the some.php itself!!!
<?
include_once("./some.php"); // is this normal?
...
?>
Jin Kwon
  • 20,295
  • 14
  • 115
  • 184

2 Answers2

2

NO.

There is no reason to include current file, itself.

If using include() not include_once(), it raise infinite loop.

TaeL
  • 1,026
  • 9
  • 17
1

The include_once() statement includes and evaluates the specified file during the execution of the script. This is a behavior similar to the include() statement, with the only difference being that if the code from a file has already been included, it will not be included again.

As the name suggests, it will be included just once. There is no reason to do it..

Asfandyar Khan
  • 1,677
  • 15
  • 34