public function add($thread) { if ($thread instanceof Thread or $thread instanceof Worker) { $this->{spl_object_hash($thread)} = $thread; } }