摘要: PHP中的clone使用官方文档:http://cn2.php.net/__clone在多数情况下,我们并不需要完全复制一个对象来获得其中属性。但有一个情况下确实需要:如果你有一个 GTK窗口对象,该对象持有窗口相关的资源。你可能会想复制一个新的窗口,保持所有属性与原来的窗口相同, 但必须是一个新的对象(因为如果不是新的对象,那么一个窗口中的改变就会影响到另一个窗口)。还有一种情况: 如果对象A中保存着对象B的引用,当你复制对象A时,你想其中使用的对象不再是对象B而是B的一个副本,那么 你必须得到对象A的一个副本。对象复制可以通过clone关键字来完成(如果可能,这将调用对象的__clone( 阅读全文
posted @ 2012-12-04 16:09 Athrun 阅读(314) 评论(0) 推荐(0) 编辑
摘要: PHP中的__call使用官方文档:http://cn2.php.net/__callpublic mixed __call ( string $name , array $arguments )public static mixed __callStatic ( string $name , array $arguments )当调用一个不可访问方法(如未定义,或者不可见)时,__call() 会被调用。当在静态方法中调用一个不可访问方法(如未定义,或者不可见)时,__callStatic() 会被调用。$name 参数是要调用的方法名称。$arguments 参数是一个数组,包含着要传递给 阅读全文
posted @ 2012-12-04 15:54 Athrun 阅读(203) 评论(0) 推荐(0) 编辑
摘要: PHP中的__set & __get使用官方说明publicvoid__set(string$name,mixed$value)publicmixed__get(string$name)publicbool__isset(string$name)publicvoid__unset(string$name)在给未定义的变量赋值时,__set()会被调用。读取未定义的变量的值时,__get()会被调用。当对未定义的变量调用isset()或empty()时,__isset()会被调用。当对未定义的变量调用unset()时,__unset()会被调用。参数$name是指要操作的变量名称。__s 阅读全文
posted @ 2012-12-04 15:26 Athrun 阅读(323) 评论(0) 推荐(0) 编辑
摘要: PHP Exception官方文档:http://cn2.php.net/exceptionsDeom 1<?phpclass Conf { private $file; private $xml; private $lastmatch; function __construct( $file ) { $this->file = $file; if ( ! file_exists( $file ) ) { throw new Exception( "file '$file' does not exist" ); ... 阅读全文
posted @ 2012-12-04 14:40 Athrun 阅读(340) 评论(0) 推荐(0) 编辑
摘要: PHP SimpleXML 简介SimpleXML 函数允许您把 XML 转换为对象。通过普通的属性选择器或数组迭代器,可以处理这个对象,就像处理任何其他对象一样。其中的一些函数需要最新的 PHP 版本。SimpleXML 函数是 PHP 核心的组成部分。无需安装即可使用这些函数。函数描述PHP__construct()创建一个新的 SimpleXMLElement 对象。5addAttribute()给 SimpleXML 元素添加一个属性。5addChild()给 SimpleXML 元素添加一个子元素。5asXML()从 SimpleXML 元素获取 XML 字符串。5attribute 阅读全文
posted @ 2012-12-04 14:32 Athrun 阅读(197) 评论(0) 推荐(0) 编辑
摘要: From :http://bbs.csdn.net/topics/360002529php 5.3新增的闭包语法介绍function() use() {}Demo1function callback($callback) { $callback();}callback(function() { print "This is a anonymous function.<br />\n";});输出: This is a anonymous function.<br />\n这里是直接定义一个匿名函数进行传递, 在以往的版本中, 这是不可用的.现在, 这 阅读全文
posted @ 2012-12-04 13:57 Athrun 阅读(252) 评论(0) 推荐(0) 编辑
摘要: Converting to objectIf an object is converted to an object, it is not modified. If a value of any other type is converted to an object, a new instance of the stdClass built-in class is created. If the value was NULL, the new instance will be empty. Arrays convert to an object with properties named b 阅读全文
posted @ 2012-12-04 13:41 Athrun 阅读(210) 评论(0) 推荐(0) 编辑
摘要: Baidu Searchms sql 2000安全SQLServer2000的安全配置SQL Server 2000的安全配置Mssql和Mysql的安全性分析 阅读全文
posted @ 2012-12-04 11:32 Athrun 阅读(141) 评论(0) 推荐(0) 编辑