摘要: <?php//文件名:Factory namespace IMooc; class Factory { //工程模式 static function creatDatabase() { $db = new Database;//如果Database的各项参数发生了变化,只需要在这里修改,不用去修改所有new出来的对象。 return $db... 阅读全文
posted @ 2016-05-24 14:30 怪咖咖 阅读(150) 评论(0) 推荐(0) 编辑
摘要: <?php //文件名:index.php define('a',__DIR__); include '/IMooc/Loader.php'; spl_autoload_register('\\IMooc\\Loader::autoload'); $Object = new \IMooc\Object(); echo $Object("test1");//对象本身不能直接当函数用,如果被当... 阅读全文
posted @ 2016-05-24 13:51 怪咖咖 阅读(8875) 评论(0) 推荐(0) 编辑
摘要: <?php //文件名:index.php define('a',__DIR__); include '/IMooc/Loader.php'; spl_autoload_register('\\IMooc\\Loader::autoload'); $Object = new \IMooc\Object(); echo $Object;//对象不能当字符串直接输出,当对象转换成字符串时,会自... 阅读全文
posted @ 2016-05-24 13:35 怪咖咖 阅读(601) 评论(0) 推荐(0) 编辑
摘要: 魔术方法 __call 静态魔术方法__callStatic 阅读全文
posted @ 2016-05-24 13:26 怪咖咖 阅读(629) 评论(0) 推荐(0) 编辑
摘要: __set、__get魔术方法: 阅读全文
posted @ 2016-05-24 11:31 怪咖咖 阅读(396) 评论(0) 推荐(0) 编辑
摘要: 数据结构:栈 队列: 堆: 固定尺寸的数组: 阅读全文
posted @ 2016-05-24 10:34 怪咖咖 阅读(320) 评论(0) 推荐(0) 编辑