diff --git a/hphp/compiler/expression/binary_op_expression.cpp b/hphp/compiler/expression/binary_op_expression.cpp index 4685bd7c1669e..93abadfdce95d 100644 --- a/hphp/compiler/expression/binary_op_expression.cpp +++ b/hphp/compiler/expression/binary_op_expression.cpp @@ -374,14 +374,16 @@ ExpressionPtr BinaryOpExpression::foldConst(AnalysisResultConstRawPtr ar) { case T_SL: { int64_t shift = v2.toInt64(); if (!RuntimeOption::PHP7_IntSemantics) { - result = v1.toInt64() << (shift & 63); + result = static_cast( + static_cast(v1.toInt64()) << (shift & 63)); } else if (shift >= 64) { result = 0; } else if (shift < 0) { // This raises an error, and so can't be folded. return ExpressionPtr(); } else { - result = v1.toInt64() << (shift & 63); + result = static_cast( + static_cast(v1.toInt64()) << (shift & 63)); } break; }