|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-08-29 04:16 UTC] steve at ssgreenberg dot name
[2008-08-29 05:25 UTC] steve at ssgreenberg dot name
[2008-08-29 08:18 UTC] bjori@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Jun 14 22:00:01 2026 UTC |
Description: ------------ The description of fsockopen is: resource fsockopen ( string $hostname [, int $port [, int &$errno [, string &$errstr [, float $timeout ]]]] ) Example #1 shows: $fp = fsockopen("www.example.com", 80, $errno, $errstr, 30); Example #2 shows: $fp = fsockopen("udp://127.0.0.1", 13, $errno, $errstr); Most user supplied example contain the same error. Only one user supplied example before mine showed the correct argument passing: $fp = fsockopen('status.icq.com', 80, &$errno, &$errstr, 8); If there is no error when fsockopen is passed control, then the wrong argument passing is not noticeable. I have not come up with an example to force an error to see what would happen. I am not sure how this bug report relates Bug #24429. If passing arguments by reference is deprecated, then the examples may be right and the description of the function may be wrong. Reproduce code: --------------- Examples of good and bad code supplied in the description. Expected result: ---------------- If the arguments to fsockopen are passed correctly and there is an operational error when fsockopen is called, then it will be possible to tell the user what went wrong. Actual result: -------------- If fsockopen incurs an error during its operation and the arguments for recording the error are passed incorrectly, then seemingly unexplainable behavior could result. Probably no useful error message will be available to explain the problem to the user.