THRIFT-2701 Update TCompactProtocol.php
Client: PHP
Patch: GitHub-User anjz <anartzn@gmail.com>
This closes #212
Removed `strrev` from `readDouble` and `writeDouble` functions. I found problems reading a double that was generated with the python library.
diff --git a/lib/php/lib/Thrift/Protocol/TCompactProtocol.php b/lib/php/lib/Thrift/Protocol/TCompactProtocol.php
index 337511e..b8a71d6 100644
--- a/lib/php/lib/Thrift/Protocol/TCompactProtocol.php
+++ b/lib/php/lib/Thrift/Protocol/TCompactProtocol.php
@@ -309,7 +309,7 @@
public function writeDouble($value) {
$data = pack('d', $value);
- $this->trans_->write(strrev($data), 8);
+ $this->trans_->write($data, 8);
return 8;
}
@@ -485,7 +485,7 @@
}
public function readDouble(&$value) {
- $data = strrev($this->trans_->readAll(8));
+ $data = $this->trans_->readAll(8);
$arr = unpack('d', $data);
$value = $arr[1];
return 8;