问题描述
如果我的index.php有两个包含:
require_once(''。/ include / WebStart.php'');
require_once(" ;包含/ Wiki.php");
然后每个包括,然后每个......等等。
等... .......
一旦调用了index.php,即使它中止(不是来自错误,而是通过
程序''自己的设计),通过require_once来完成我的数千个PHP
互连文件中的每一个。行全部加载,编译,并将
存入内存?
If my index.php has two includes:
require_once( ''./includes/WebStart.php'' );
require_once( "includes/Wiki.php" );
Then each of those have includes, then each of those...... etc. etc.
etc..........
Once index.php is called, even if it aborts (not from an error but say by
the program''s own design), do every single one of my thousands of PHP
interlinked files by "require_once" lines get all loaded, compiled, and put
into memory?
推荐答案
将
put
另外,如果我把require_once放在
其他一些代码我的中止了吗?
Also, does it matter if I put "require_once" lower down in the code after
some other code my abort it?
否 - 您可能会觉得这很奇怪。
无论如何都会包含include / require。
例如:
<? php
if(TRUE){
包括myfile.php;
}否则{
包括" yourfile.php";
}
?>
在上面的例子中 - 将包含BOTH文件无论如何。
No - and you may find this weird.
An include/require will be included no matter what.
For example:
<? php
if(TRUE){
include "myfile.php";
} else {
include "yourfile.php";
}
?>
In the above example - BOTH files will be included no matter what.
after
否 - 您可能会觉得这很奇怪。
无论如何都会包含include / require。
例如:
<? php
if(TRUE){
包括myfile.php;
}否则{
包括" yourfile.php";
}
?>
在上面的例子中 - 将包含BOTH文件有什么关系。
No - and you may find this weird.
An include/require will be included no matter what.
For example:
<? php
if(TRUE){
include "myfile.php";
} else {
include "yourfile.php";
}
?>
In the above example - BOTH files will be included no matter what.
好的,但这两个文件都包含/要求。他们的包含/要求是否也包括在内?
Okay, but both files have include/requires. Will their include/requires be
included, too?
这篇关于PHP包括问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!