摘要: class A{ public $ab= 1; private $bc=2; public static $instance = null; public function abc($a,$b){ return $a . "|".$b; } public function dd(){ return 阅读全文
posted @ 2020-08-28 15:59 爱搬砖的小码农 阅读(256) 评论(0) 推荐(0) 编辑
摘要: //依赖注入是应用于一个类的实例化需要依赖另外一个类的场景//Person依赖于Student类,Student类注入到Person class Person{ public function teach($obj){ return $obj->study(); } } class Student{ 阅读全文
posted @ 2020-08-28 14:43 爱搬砖的小码农 阅读(270) 评论(0) 推荐(0) 编辑