public static function lines(string ...$lines): string
    {
        $head = true;
        return join(
                '',
                array_map(
                        function($line) use (&$head)
                        {
                            if (empty($line) && $head) {
                                $head = false;
                                return self::emptyLine();
                            }

                            if ($head) {
                                return self::line($line);
                            }

                            return $line;
                        },
                        $lines
                )
        );
    }
public static function lines(string ...$lines): string
    {
        $head = true;
        return join(
                '',
                array_map(
                        function($line) use (&$head)
                        {
                            if (empty($line) && $head) {
                                $head = false;
                                return self::emptyLine();
                            }

                            if ($head) {
                                return self::line($line);
                            }

                            return $line;
                        },
                        $lines
                )
        );
    }
public static function lines ( string ... $ lines ) : string { $ head = true ; return join ( '' , array_map ( function ( $ line ) use ( & $ head ) { if ( empty ( $ line ) && $ head ) { $ head = false ; return self :: emptyLine ( ) ; } if ( $ head ) { return self :: line ( $ line ) ; } return $ line ; } , $ lines ) ) ; }
creates valid http lines from given input lines

If the array contains an empty line all lines after this empty line are
considered to belong to the body and will be returned as they are.

@param   string[]  $lines
@return  string
@since   4.0.0
creates valid http lines from given input lines