Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

socket_accept: wrong statements about socket_set_blocking, false and socket_last_error

オープン 初心者向け
#5,974 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@qodelicious がすでに取り組んでいます。

2026年10月21日 から。

  • #5986 @qodelicious による — オープン

評価

難易度
1/5
見積もり時間
1〜3時間
初心者へのやさしさ
89/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
documentation

調査の方向性

socket-acceptのマニュアルページと、issueで言及されているsocketsの例のページから始めてください。ブロッキング呼び出しを更新し、falseは接続が保留されていないことを意味すると説明し、両方の箇所で引数なしのsocket_last_error()を使用してください。両方のページにこれらの修正が反映されたら完了です。

索引モデルが issue の本文から書いたものです。

説明

bug
Affected page

https://www.php.net/manual/en/function.socket-accept.php

Issue description
  • socket_set_blocking() doesn't work on a Socket (it is an alias of stream_set_blocking()); only socket_set_nonblock() does.
  • false is returned only when no connection is pending (EAGAIN), without a warning.
  • socket_last_error() gives the error only without argument: after a failed accept, socket_last_error($listener) returns 0. The example in the sockets examples page does exactly that.
Steps to reproduce
$l = socket_create(AF_INET, SOCK_STREAM, 0);
socket_set_blocking($l, false);
// TypeError: Argument #1 ($stream) must be of type resource, Socket given
Suggested fix

Mention socket_set_nonblock() instead, say false means no pending connection, and call socket_last_error() without argument (in the page and in the example).

主要言語
XML
スター
600
フォーク
903
平均マージ
1日 5時間
マージ済み PR(30日)
81

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

php/doc-en のほかの issue

php/doc-en の issue をすべて見る

似ている issue

Documentation の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。