摘要:
class p{ public $v1 = 1; function __construct($n){ $this->v1 = $n; echo "被创建了"; } function __destruct(){ echo "被销毁了"; } } echo "1"; $p1 = new p(5); $p 阅读全文
摘要:
class c1{ 静态属性 static $v1 10; } 修改静态属性的值 c1::$v1 = 100; 取得静态属性的值 $s1 = c1::$v1; echo "s1 = $s1"; $c1 = new c1(); $c2=newc2(); echo "c1中的静态属性v1=".$c1:: 阅读全文