readKey(); switch($c) { case chr(ctrl_key('q')): exit(0); break; } } protected function readKey(): string { return read_stdin(1); } }