摘要: class p{ public $v1 = 1; function __construct($n){ $this->v1 = $n; echo "被创建了"; } function __destruct(){ echo "被销毁了"; } } echo "1"; $p1 = new p(5); $p 阅读全文
posted @ 2018-03-06 15:55 php1218lxl 阅读(91) 评论(1) 推荐(0) 编辑
摘要: class c1{ 静态属性 static $v1 10; } 修改静态属性的值 c1::$v1 = 100; 取得静态属性的值 $s1 = c1::$v1; echo "s1 = $s1"; $c1 = new c1(); $c2=newc2(); echo "c1中的静态属性v1=".$c1:: 阅读全文
posted @ 2018-03-06 15:32 php1218lxl 阅读(78) 评论(0) 推荐(0) 编辑