method = $method; $this->params = $params; $this->result = null; $this->joined = false; } public function run(){ if(($this->result=call_user_func_array($this->method, $this->params))){ return true; }else{ return false; } } public static function call($method, $params = array()){ $thread = new Async($method, $params); if($thread->start()){ return $thread; } } public function __toString(){ if(!$this->joined){ $this->joined = true; $this->join(); } return $this->result; } }