Same fix to thrift codebase

Reviewed By: aditya

 line, and those below, will be ignored--

M    php/src/Thrift.php
M    php/src/transport/TSocket.php
M    php/src/transport/TPhpStream.php


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665021 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/php/src/transport/TPhpStream.php b/lib/php/src/transport/TPhpStream.php
index d650935..1f37173 100644
--- a/lib/php/src/transport/TPhpStream.php
+++ b/lib/php/src/transport/TPhpStream.php
@@ -66,7 +66,7 @@
   }
 
   public function write($buf) {
-    while (!empty($buf)) {
+    while (strlen($buf) > 0) {
       $got = @fwrite($this->outStream_, $buf);
       if ($got === 0 || $got === FALSE) {
         throw new Exception('TPhpStream: Could not write '.strlen($buf).' bytes');