Bug #53753 [Fbk->Csd]: fread on unix doman socket returns read numeric value 0 as false

From: Date: Mon, 17 Jan 2011 19:39:51 +0000
Subject: Bug #53753 [Fbk->Csd]: fread on unix doman socket returns read numeric value 0 as false
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-157963@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53753&edit=1

 ID:                 53753
 User updated by:    akshaydeepak at gmail dot com
 Reported by:        akshaydeepak at gmail dot com
 Summary:            fread on unix doman socket returns read numeric
                     value 0 as false
-Status:             Feedback
+Status:             Closed
 Type:               Bug
 Package:            Streams related
 Operating System:   UNIX
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[2011-01-15 00:32:48] 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-14 21:26:00] 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. 



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53753&edit=1


Thread (3 messages)

« previous php.bugs (#157963) next »