php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53753 fread on unix doman socket returns read numeric value 0 as false
Submitted: 2011-01-14 21:26 UTC Modified: 2011-01-17 20:39 UTC
From: akshaydeepak at gmail dot com Assigned:
Status: Closed Package: Streams related
PHP Version: 5.3.5 OS: UNIX
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: akshaydeepak at gmail dot com
New email:
PHP Version: OS:

 

 [2011-01-14 21:26 UTC] akshaydeepak at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.fread#Return Values
---
Trying to read from a unix domain socket. The content being received is a single 
numeric value 0 which fread returns as false and is not detected even with (false 
=== $ret). However, if the number is changed to single numeric value 1, then fread 
returns 1 as a string as expected and  (1 === $ret) fails confirming that the $ret 
is actually a string. 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-15 00:32 UTC] cataphract@php.net
-Status: Open +Status: Feedback
 [2011-01-15 00:32 UTC] cataphract@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2011-01-17 20:39 UTC] akshaydeepak at gmail dot com
-Status: Feedback +Status: Closed
 [2011-01-17 20:39 UTC] akshaydeepak at gmail dot com
Sorry, my mistake. (false === $ret) works. I had multiple reads in my code and at 
one place i had put (false == $ret) instead of '==='. Got to know when I was 
trying to write a short sample script to reproduce the bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 06:01:29 2024 UTC