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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 07:01:27 2024 UTC