首 页 ASP ASP.NET PHP JSP Ajax DIV+CSS JavaScript XML C#
MySQL MSSQL Access Oracle Linux Server 电脑技巧 网络安全 建站经验 其它

PHP 5.0对象模型探索之重载

整理日期:2007年06月14日 【字体:


伊图教程网[www.etoow.com]
http://www.etoow.com/html/2007-06/1181852708.html

 function _set($property_name, $value)
 {
  $this->properties[$property_name] = $value;
 }

 function _call($function_name, $args)
 {
  print("Invoking $function_name() n");
  print("Arguments: ");
  print_r($args);

  return(TRUE);
 }
}
$o = new Overloader();

//invoke _set() 给一个不存在的属性变量赋值,激活_set()
$o->dynaProp = "Dynamic Content";

//invoke _get() 激活_get()
print($o->dynaProp . "n");

//invoke _call() 激活_call()
$o->dynaMethod("Leon", "Zeev");
?>
Tags:
PHP 5.0对象模型探索之重载
'http://www.etoow.com/html/2007-06/1181852708.html
1
 
信息搜索
  
联系我们关于本站广告服务设为首页 收藏本站友情链接网站地图
Copyright © Etoow.com Inc. All Rights Reserved