[doc-en] master: socket_accept(): fix the non-blocking and socket_last_error() notes (#5986)

From: Date: Wed, 21 Oct 2026 10:12:39 +0000
Subject: [doc-en] master: socket_accept(): fix the non-blocking and socket_last_error() notes (#5986)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23869@lists.php.net to get a copy of this message
Author: qodelicious (qodelicious) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-10-21T12:12:35+02:00 Commit: https://github.com/php/doc-en/commit/73214e39677b843f11e152078ce8f70af6c22771 Raw diff: https://github.com/php/doc-en/commit/73214e39677b843f11e152078ce8f70af6c22771.diff socket_accept(): fix the non-blocking and socket_last_error() notes (#5986) * socket_accept(): fix the non-blocking and socket_last_error() notes * Use simpara for the changed paragraphs Changed paths: M reference/sockets/examples.xml M reference/sockets/functions/socket-accept.xml Diff: diff --git a/reference/sockets/examples.xml b/reference/sockets/examples.xml index 1058449bb803..5ad07cce9c98 100644 --- a/reference/sockets/examples.xml +++ b/reference/sockets/examples.xml @@ -45,7 +45,7 @@ if (socket_listen($sock, 5) === false) { do { if (($msgsock = socket_accept($sock)) === false) { - echo "socket_accept() failed: reason: " . socket_strerror(socket_last_error($sock)) . "\n"; + echo "socket_accept() failed: reason: " . socket_strerror(socket_last_error()) . "\n"; break; } /* Send instructions. */ diff --git a/reference/sockets/functions/socket-accept.xml b/reference/sockets/functions/socket-accept.xml index c4eaf4862a11..e718a68ab083 100644 --- a/reference/sockets/functions/socket-accept.xml +++ b/reference/sockets/functions/socket-accept.xml @@ -12,7 +12,7 @@ <type class="union"><type>Socket</type><type>false</type></type><methodname>socket_accept</methodname> <methodparam><type>Socket</type><parameter>socket</parameter></methodparam> </methodsynopsis> - <para> + <simpara> After the socket <parameter>socket</parameter> has been created using <function>socket_create</function>, bound to a name with <function>socket_bind</function>, and told to listen for connections @@ -24,9 +24,9 @@ connections, <function>socket_accept</function> will block until a connection becomes present. If <parameter>socket</parameter> has been made non-blocking using - <function>socket_set_blocking</function> or - <function>socket_set_nonblock</function>, &false; will be returned. - </para> + <function>socket_set_nonblock</function> and there are no pending + connections, &false; will be returned without raising a warning. + </simpara> <para> The <classname>Socket</classname> instance returned by <function>socket_accept</function> may not be used to accept new @@ -54,13 +54,14 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; - <para> + <simpara> Returns a new <classname>Socket</classname> instance on success, or &false; on error. The actual error code can be retrieved by calling - <function>socket_last_error</function>. This error code may be passed to + <function>socket_last_error</function> without an argument, as the error + is not stored on <parameter>socket</parameter>. This error code may be passed to <function>socket_strerror</function> to get a textual explanation of the error. - </para> + </simpara> </refsect1> <refsect1 role="changelog">

« previous php.doc.cvs (#23869) next »