php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55165 Additional equal sign, misleading.
Submitted: 2011-07-09 09:55 UTC Modified: 2011-07-11 11:04 UTC
From: tamate at hotmail dot com Assigned:
Status: Wont fix Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tamate at hotmail dot com
New email:
PHP Version: OS:

 

 [2011-07-09 09:55 UTC] tamate at hotmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.socket-last-error%23Examples
---
Additional equal sign.

Test script:
---------------
Should be
if ($fp == false) {
    $errorcode = socket_last_error();
    $errormsg = socket_strerror($errorcode);
    
    die("Couldn't create socket: [$errorcode] $errormsg");
}
and not
if ($fp === false) {
    $errorcode = socket_last_error();
    $errormsg = socket_strerror($errorcode);
    
    die("Couldn't create socket: [$errorcode] $errormsg");
}

Expected result:
----------------
Using the old code, no error will be found, and thus, no error will be shown.

Actual result:
--------------
If $fp fails, error code with error message will be displayed.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-11 11:04 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 [2011-07-11 11:04 UTC] aharvey@php.net
Looks fine to me: socket_create() returns boolean false on error.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Mar 12 11:01:32 2025 UTC