From: eletuchy Date: Wed, 13 Feb 2008 22:41:03 +0000 (+0000) Subject: [thrift] grrrr ... TPhpStream can read the string '0' X-Git-Tag: 0.2.0~995 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=260a5fa08e87643bd5c001cc25311e9074795cfc;p=common%2Fthrift.git [thrift] grrrr ... TPhpStream can read the string '0' Summary: php sucks Reviewed By: mcslee Test Plan: thrift call with string '0' has same behavior as string '1' Revert Plan: sure git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665477 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/php/src/transport/TPhpStream.php b/lib/php/src/transport/TPhpStream.php index d4646f1a..d1350d71 100644 --- a/lib/php/src/transport/TPhpStream.php +++ b/lib/php/src/transport/TPhpStream.php @@ -70,7 +70,7 @@ class TPhpStream extends TTransport { public function read($len) { $data = @fread($this->inStream_, $len); - if (!$data) { + if ($data === FALSE || $data === '') { throw new TException('TPhpStream: Could not read '.$len.' bytes'); } return $data;