__call()和call_user_func_array()

price=new Index();
    }


    public function __call($pub,$age){
        if(method_exists($this->price,$pub)){
            call_user_func_array([$this->price,$pub],$age);
        }

    }

}



$travle=new Travel();
$travle->price('10','10000');

你可能感兴趣的:(__call()和call_user_func_array())