php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #61894 Missed part of echo in example
Submitted: 2012-05-02 05:20 UTC Modified: 2012-05-04 19:38 UTC
From: iliavlad at mail dot ru Assigned: preinheimer (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2012-05-02 05:20 UTC] iliavlad at mail dot ru
Description:
------------
Missed part of echo in example
---
From manual page: http://www.php.net/function.socket-recv#refsect1-function.socket-recv-examples
---

Test script:
---------------
echo "Reading response:\n\n";
$buf = 'This is my buffer.';
if (false !== ($bytes = socket_recv($socket, $buf, 2048, MSG_WAITALL))) {
    echo "Read $bytes bytes from socket_recv(). Closing socket...";
} else {
    echo "socket_recv() failed; reason: " . socket_strerror(socket_last_error($socket)) . "\n";
}
socket_close($socket);

echo $buf . "\n";

Expected result:
----------------
Reading response:

Read 999 bytes from socket_recv().Closing socket...HTTP/1.1 200 OK
...
Content-Type: text/html; charset=UTF-8

OK.

Actual result:
--------------
Reading response:

Closing socket...HTTP/1.1 200 OK
...
Content-Type: text/html; charset=UTF-8

OK.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-05-04 19:32 UTC] preinheimer@php.net
-Assigned To: +Assigned To: preinheimer
 [2012-05-04 19:35 UTC] preinheimer@php.net
Automatic comment from SVN on behalf of preinheimer
Revision: http://svn.php.net/viewvc/?view=revision&revision=325538
Log: Adding missing text to code output, as per Doc Bug #61894
 [2012-05-04 19:38 UTC] preinheimer@php.net
-Status: Assigned +Status: Closed
 [2012-05-04 19:38 UTC] preinheimer@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

resolved in commit 325538
I went with 123 bytes as that's what running the code gave me (ignoring the fact that the rest was different, They're now redirecting example.com elsewhere.)
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Tue Oct 06 04:00:02 2026 UTC