类中调用另一个类
class A {
public $a;
public function __construct(){
$num = 111;
$this->a = $num;
}
}
class B {
public function b1($data){
echo $data;
}
}
$a = new A();
$b = new B();
$b->b1($a->a);
类中调用另一个类
class A {
public $a;
public function __construct(){
$num = 111;
$this->a = $num;
}
}
class B {
public function b1($data){
echo $data;
}
}
$a = new A();
$b = new B();
$b->b1($a->a);
转载于:https://my.oschina.net/u/3538113/blog/1568161