php / php/doc-en

Use HTTP/1.1 instead of HTTP/1.0 in examples in the manual?

Open
#710 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
XML
Stars
596
Forks
890
Avg merge
1d 15h
Merged PRs (30d)
55

Description

Checked when looking at https://github.com/php/doc-en/pull/709 - there's also event/ but I'm not familiar with that

Users may be surprised if they add headers to those examples and those headers only exist in HTTP/1.1.

For stream/book.xml - is it actually using HTTP/1.0 or HTTP/1.1 - maybe there should be a changelog (I forget if that or something else was what changed in 8.0)

NOTE: HTTP/1.0 may actually be faster for some of the examples due to not supporting keepalive if the server closes connections (no keepalive in 1.0) - Connection: close may need to be added to ensure the same behavior

stream/examples.xml
49:fwrite($sock, "POST /form_action.php HTTP/1.0\r\n");

stream/functions/stream-socket-client.xml
156:    fwrite($fp, "GET / HTTP/1.0\r\nHost: www.example.com\r\nAccept: */*\r\n\r\n");

stream/book.xml
21-    A <literal>wrapper</literal> is additional code which tells the stream how to handle
22-    specific protocols/encodings.  For example, the <literal>http</literal>
23:    wrapper knows how to translate a URL into an <literal>HTTP/1.0</literal>
24-    request for a file on a remote server.  There are many wrappers
25-    built into PHP by default (See <xref linkend="wrappers"/>),
26-    and additional, custom wrappers may be added either within a
27-    PHP script using <function>stream_wrapper_register</function>,

stream/functions/stream-set-timeout.xml
81:    fwrite($fp, "GET / HTTP/1.0\r\n\r\n");

network/functions/header.xml
73://    (to override http status messages for clients that are still using HTTP/1.0)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the HTTP/1.0 references in stream/examples.xml, stream/functions/stream-socket-client.xml, stream/book.xml, stream/functions/stream-set-timeout.xml, and network/functions/header.xml. Verify the documented stream behavior and whether the examples should use HTTP/1.1 or explicitly close connections. Done means the affected examples and explanatory text consistently reflect the confirmed behavior, with a changelog entry if the behavior changed in PHP 8.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.