bramp/protoc-gen-php — pull request #3 by koconder (2013-07-11 16:29:56+00:00)
Title: Updated to fix creationTime

At least in 32 bit systems the getCreationTime() method on a comment returns invalid values, sometimes even negative values!

I've altered the following code inside the file protocolbuffers.inc.php :

I've replaced:
$i = 0;
$shift = 0;
for ($j = 0; $j < $len; $j++) {
$i |= ((ord($value[$j]) & 0x7F) << $shift);
$shift += 7;
}
By:
$i = 0.0;
for ($j = $len-1; $j >= 0; $j--) $i = $i * 128 + (ord($value[$j]) & 0x7F);

Now the command date("Y-m-d H:i:s",$comment->getCreationTime()/1000) returns the correct date!