count($this->opinion), 'size' => count($this->size), 'age' => count($this->age), 'shape' => count($this->shape), 'color' => count($this->color), 'origin' => count($this->origin), 'material' => count($this->material), 'purpose' => count($this->purpose), 'noun' => count($this->noun), ]; // perform mixed-radix conversion $order = ['noun', 'purpose', 'material', 'origin', 'color', 'shape', 'age', 'size', 'opinion']; $digits = []; foreach($order as $category){ $radix = $bases[$category]; $digits[$category] = $id % $radix; $id = intdiv($id, $radix); } if($id > 0){ throw new Exception("ID too large"); } foreach($list as $k){ $phrase[] = $this->$k[$digits[$k]]; } return implode('-', $phrase); } } function generate(){ $generator = new TicketPhraseGen(); $ticket_number = 2; $phrase = $generator->convert_id_to_phrase($ticket_number); echo "Ticket #{$ticket_number} is {$phrase}"; } generate(); function password_test(){ $password = "pass!local"; echo password_hash($password, PASSWORD_DEFAULT); }