摘要: <?php // __autoload 当使用未定义的类的时候,会自动调用这个函数。 // 比如在本文件的同目录下有个 classOne.php 文件,这个文件中有个 classOne 类。 function __autoload($s) { require_once __DIR__."./$s".".php"; } $obj = new classOne(); $obj->f();?> 阅读全文
posted @ 2013-03-15 16:39 刘牛德 阅读(151) 评论(0) 推荐(0)
摘要: function ff() { echo __FUNCTION__; // output : ff } class MyClass { static public function fclass() { echo __CLASS__; // MyClass echo "<br/>"; echo __METHOD__; // MyClass::fclass } } echo __FILE__; // output : c:\web... 阅读全文
posted @ 2013-03-15 16:25 刘牛德 阅读(113) 评论(0) 推荐(0)
摘要: <?php class A { public function foo () { if(isset($this)) { echo "\$this is defined ("; echo get_class($this); echo ")\n"; } else { echo "\$this is not defined .\n"; } } stati... 阅读全文
posted @ 2013-03-15 16:01 刘牛德 阅读(247) 评论(0) 推荐(0)