Issue
I have 3 different files-
fileMainIncludeEverywhere.php
... include_once('fileMinorInclude.php'); ?>
fileMinorInclude.php
... include_once('fileMainIncludeEverywhere.php'); ...
fileToRun.php
... include_once('fileMainIncludeEverywhere.php'); ...
I have a lot of files like fileToRun.php.
Currently I'm not facing any errors in my code, but I want to know if there's any case where this would fail?
Solution
I think no error in this case. Because include_once
will only load the file for the first time then upcoming load request will be rejected for the same file.
So from your example:
fileToRun.php
will loadfileMainIncludeEverywhere.php
(first call)fileMainIncludeEverywhere.php
will loadfileMinorInclude.php
(first call)fileMinorInclude.php
will call to loadfileMainIncludeEverywhere.php
but it will be rejected as it has been already loaded in first step.
Hope it will help.
Answered By - d.coder Answer Checked By - Robin (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.