From df8390790aae6025e95687a37eea81a4757966d0 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 10 Nov 2016 11:20:50 -0800 Subject: Fix php c extension on 32-bit machines. (#2348) --- php/src/Google/Protobuf/Internal/Message.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'php/src/Google/Protobuf') diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php index 38513e91..3d1f1598 100644 --- a/php/src/Google/Protobuf/Internal/Message.php +++ b/php/src/Google/Protobuf/Internal/Message.php @@ -125,6 +125,16 @@ class Message $oneof = $this->desc->getOneofDecl()[$field->getOneofIndex()]; $oneof_name = $oneof->getName(); $this->$oneof_name = new OneofField($oneof); + } else if ($field->getLabel() === GPBLabel::OPTIONAL && + PHP_INT_SIZE == 4) { + switch ($field->getType()) { + case GPBType::INT64: + case GPBType::UINT64: + case GPBType::FIXED64: + case GPBType::SFIXED64: + case GPBType::SINT64: + $this->$setter("0"); + } } } } -- cgit v1.2.3