includes the expected class in the exception, otherwise the error is harder to track down (#3371)
diff --git a/php/src/Google/Protobuf/Internal/GPBUtil.php b/php/src/Google/Protobuf/Internal/GPBUtil.php index 76f84cb..05d5c39 100644 --- a/php/src/Google/Protobuf/Internal/GPBUtil.php +++ b/php/src/Google/Protobuf/Internal/GPBUtil.php
@@ -194,7 +194,7 @@ public static function checkMessage(&$var, $klass) { if (!$var instanceof $klass && !is_null($var)) { - throw new \Exception("Expect message."); + throw new \Exception("Expect $klass."); } }