aboutsummaryrefslogtreecommitdiffhomepage
path: root/conformance/conformance_php.php
diff options
context:
space:
mode:
Diffstat (limited to 'conformance/conformance_php.php')
-rwxr-xr-xconformance/conformance_php.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/conformance/conformance_php.php b/conformance/conformance_php.php
index 20fb5082..d5e91258 100755
--- a/conformance/conformance_php.php
+++ b/conformance/conformance_php.php
@@ -53,7 +53,7 @@ function doTest($request)
}
} elseif ($request->getPayload() == "json_payload") {
try {
- $test_message->jsonDecode($request->getJsonPayload());
+ $test_message->mergeFromJsonString($request->getJsonPayload());
} catch (Exception $e) {
$response->setParseError($e->getMessage());
return $response;
@@ -67,7 +67,7 @@ function doTest($request)
} elseif ($request->getRequestedOutputFormat() == WireFormat::PROTOBUF) {
$response->setProtobufPayload($test_message->serializeToString());
} elseif ($request->getRequestedOutputFormat() == WireFormat::JSON) {
- $response->setJsonPayload($test_message->jsonEncode());
+ $response->setJsonPayload($test_message->serializeToJsonString());
}
return $response;
@@ -79,7 +79,8 @@ function doTestIO()
if (strlen($length_bytes) == 0) {
return false; # EOF
} elseif (strlen($length_bytes) != 4) {
- trigger_error("I/O error", E_USER_ERROR);
+ fwrite(STDERR, "I/O error\n");
+ return false;
}
$length = unpack("V", $length_bytes)[1];