
OOP面向对象
文章平均质量分 68
公众号:码农富哥
在一线大厂工作的码农,我开了公众号:【码农富哥】,工作之余致力于分享编程,算法,服务端架构,计算机基础(MySQL, Linux,TCP/IP, Python)的原创知识文章,欢迎大家关注交流!
展开
-
购物车类 单例+session 结合
<?php class cart{ static public $ins = null; public $rand = 0; public $item = array(); protected function __construct(){ $this->rand = mt_rand(0,9999); } public static function getIns(){ i原创 2013-03-05 14:39:58 · 2257 阅读 · 0 评论 -
__call() __callStatic() 的用法
class whether{ static public function tianqi($area){ echo $area.'的天气预报'; } static public function __callStatic($func,$argu){ self::tianqi($func); } } if(isset($_GET[method])){ $method=原创 2013-01-19 16:46:47 · 2525 阅读 · 1 评论 -
面向对象的 静态属性,静态方法 static 详解
class Human { static public $head = 1; public function changeHead() { Human::$head = 9; } public function getHead() { return Human::$head; } }静态属性: // 现在没有对象,想原创 2013-01-18 08:37:01 · 1043 阅读 · 0 评论