打开PHP5对象,不需要先声明变量名
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了打开PHP5对象,不需要先声明变量名相关的知识,希望对你有一定的参考价值。
I use this object verry often, so that I only need to pass one object as parameter on any function. No need to wory when we refactore the functionUsage:
$var = new open();
$var->url = 'http://www.world.com';
$var->title = 'Testing Site';
echo some_function($var);
//php5 only// class open { { $this->fromArray($a); } function __set($name,$val) { $this->____x[$name] = $val; } function __get($name) { } function __isset($name) { } function toArray() { return $this->____x; } { } }
以上是关于打开PHP5对象,不需要先声明变量名的主要内容,如果未能解决你的问题,请参考以下文章