【发布时间】:2012-08-11 19:32:05
【问题描述】:
我说的是 CodeIgniter 框架的Common.php 文件(系统/核心文件夹)。
// 不需要回答这个问题!
我一直在浏览代码,无法理解 load_class 函数的 start 处的这些特定行。
static $_classes = array();
// Does the class exist? If so, we're done...
if (isset($_classes[$class]))
{
return $_classes[$class];
我的疑问是,将变量声明为空数组并立即检查该数组中是否存在某个键是不是毫无意义?还是我错过了与 static 关键字相关的内容?
【问题讨论】:
标签: php codeigniter static