<?php
/*function __autoload($class){
$file = $class.'.class.php';
if(is_file($file)){
require_once($file);
}
*/
/*function loadPrint($class){
$file = $class.'.class.php';
if(is_file($file)){
require_once($file);
}
}*/
class Test{
public static function loadPrint($class){
$file = $class.'.class.php';
if(is_file($file)){
require_once($file);
}
}
}
//spl_autoload_register(loadPrint);
//调用静态方法
spl_autoload_register("Test::loadPrint");
$obj = new PRINTIT();
$obj->doPrint();
__autoload与spl_autoload_register
最新推荐文章于 2021-04-02 14:57:48 发布