【发布时间】:2011-10-28 10:20:55
【问题描述】:
我在使用 php 5.2 的主机公司,我使用的一些库是用 5.3 编写的,并且代码之间存在某些不兼容性。
首先有什么替代方法:
use \folder1\folder2\class_file;
其次是什么:
$sample = new \folder1\folder2\class_file($arg1, arg2);
提前致谢。
【问题讨论】:
-
"新 \folder1\folder2\class_file($arg1, arg2);"是“use \folder1\folder2\class_file;”的替代品,因此避免使用“use”。
标签: php namespaces new-operator slash php-5.2