What is www.phpbenchmarks.com?
You will find lot of benchmarks for PHP frameworks and template engines.
You can compare results between Apache Bench and Siege, PHP 5.6 to 7.3 and versions of your favorites PHP code.
It's dependency for small JSON serialization benchmark.
You can find how we benchmark it on benchmarking protocol page.
use PhpBenchmarks\BenchmarkJsonSerializationSmallOverload\BenchmarkService;
BenchmarkService::getDataToSerialize();
As serialization don't need to write anything to response body, when we validate your serialization we add a parameter into query string to indicate you need to write serialization result into response body.
use PhpBenchmarks\BenchmarkJsonSerializationSmallOverload\BenchmarkService;
// Write serialized data to response body if isWriteToResponseBody() return true, to validate it.
if (BenchmarkService::isWriteToResponseBody()) {
echo $serializer->serialize(BenchmarkService::getDataToSerialize());
// Only serialize data if isWriteToResponseBody() return false, to benchmark it.
} else {
$serializer->serialize(BenchmarkService::getDataToSerialize());
}