Home >Backend Development >PHP Tutorial >instantiationexception php include efficiency comparison of two ways to load files
Let’s talk about two methods first:
1) Define a string variable to store the list of files to be loaded. Then foreach loads.
Copy the code The code is as follows:
$a = '/a.class.php;/Util/b.class.php;/Util/c.class.php';
$b = '/ d.php;/e.class.php;/f.class.php;/g.class.php';
// Load basic system files
$kernel_require_files = explode(';', $a);//SYS_REQUIRE_LIB_FILE_LIST );
foreach($kernel_require_files as $f){
require_once(SYS_LIB_PATH.'/System'.$f);
}
// Load basic system files
$kernel_require_files = explode(';', $b);/ /SYS_BASE_FILE_LIST);
foreach($kernel_require_files as $f){
require_once(KERNEL_PATH.$f);
}
Copy code The code is as follows:
require_once('func.php');
require_once('LangManager.class.php');
require_once('_KernelAutoLoader.class.php ');
require_once('ApplicationSettingManager.class.php');
require_once('lib/System/Activator.class.php');
require_once('lib/System/Util/CXML.class.php');
require_once('lib/System/Util/CWeb.class.php');
The above introduces the efficiency comparison between the two ways of loading files using instantiationexception php include, including the content of instantiationexception. I hope it will be helpful to friends who are interested in PHP tutorials.