public static function in($message, ...$args) {
        if ($message !== '') {
            if (count($args) > 0) {
                $message = call_user_func_array(
                    'sprintf',
                    array_merge([$message], $args)
                );
            }

            $message .= ' ';
        }

        fwrite(STDERR, $message);

        $input = fgets(STDIN);

        if ($input === false) {
            throw new Exception('Unable to read from STDIN');
        }

        return trim($input);
    }
public static function in($message, ...$args) {
        if ($message !== '') {
            if (count($args) > 0) {
                $message = call_user_func_array(
                    'sprintf',
                    array_merge([$message], $args)
                );
            }

            $message .= ' ';
        }

        fwrite(STDERR, $message);

        $input = fgets(STDIN);

        if ($input === false) {
            throw new Exception('Unable to read from STDIN');
        }

        return trim($input);
    }
public static function in ( $ message , ... $ args ) { if ( $ message !== '' ) { if ( count ( $ args ) > 0 ) { $ message = call_user_func_array ( 'sprintf' , array_merge ( [ $ message ] , $ args ) ) ; } $ message .= ' ' ; } fwrite ( STDERR , $ message ) ; $ input = fgets ( STDIN ) ; if ( $ input === false ) { throw new Exception ( 'Unable to read from STDIN' ) ; } return trim ( $ input ) ; }
Read from STDIN

@param string $message Message
@param mixed ...$args (Optional) One or more arguments

@return string User input

@throws Exception on error
Read from STDIN