Serialization to a small JSON

This benchmark must serialize a small dataset as fast as possible.
It has exaclty same features as Serialization to a big JSON benchmark who multiply each data to serialize in this benchmark by 10.

Call GET
Serialization JSON Example
Serialization of integers 1,000 Example
Serialization of floats 1,000 Example
Serialization of strings 1,000 Example
Serialization of booleans 1,000 Example
Serialization of nulls values 1,000 Example
Serialization of arrays 100 Example
Serialization of objets 1,000 Example
Custom serializers 100 Example
Response JSON of 512 KB Example

PHP

#1 PHP 8.0 2.4 ms
40,000
#2 PHP 7.3 2.7 ms
37,282
#3 PHP 7.4 3.1 ms
36,283
#4 PHP 7.2 4.2 ms
29,336
#5 PHP 7.0 3.6 ms
28,744

JSON serializers