3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ArrayValue implements JsonSerializable { public function __construct(array $array) { $this->array = $array; } public function jsonSerialize(): mixed { return $this->array; } } $array = ['foo' => 'bar', 'quux' => 'baz']; echo json_encode(new ArrayValue($array), JSON_PRETTY_PRINT);

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.110.0040.00420.94
8.3.100.0100.00617.00
8.3.90.0180.00026.77
8.3.80.0050.00518.41
8.3.70.0070.00716.75
8.3.60.0070.00716.88
8.3.50.0150.00318.44
8.3.40.0070.00718.71
8.3.30.0120.00318.66
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.230.0030.00622.58
8.2.220.0000.01024.06
8.2.210.0120.00626.77
8.2.200.0030.00618.29
8.2.190.0150.00016.58
8.2.180.0160.00325.92
8.2.170.0080.00818.79
8.2.160.0130.00622.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0040.00420.75
8.2.110.0030.00620.44
8.2.100.0060.00320.41
8.1.290.0000.01030.84
8.1.280.0120.00625.92
8.1.270.0000.00823.99
8.1.260.0040.01126.35
8.1.250.0080.00028.09
8.1.240.0000.00918.77
8.1.230.0100.00018.91
8.1.90.0090.00217.42
8.1.20.0090.00317.62
8.0.150.0050.00616.80

preferences:
24.08 ms | 403 KiB | 5 Q