这两种包含外部脚本的不同方式在性能上是否存在差异?
不使用变量:
include $_SERVER['DOCUMENT_ROOT'].'/class/conf.php';
include $_SERVER['DOCUMENT_ROOT'].'/class/Db.php';
include $_SERVER['DOCUMENT_ROOT'].'/class/Posts.php';
使用变量:
$path = $_SERVER['DOCUMENT_ROOT'];
include $path.'/class/conf.php';
include $path.'/class/Db.php';
include $path.'/class/Posts.php';
为了记忆的目的,我越能避免变量,但我不知道这是否是提高性能的好习惯。