3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Dummy implements JsonSerializable{ public function jsonSerialize() { global $flag; if ($flag) { exit; } else { return "xxxx"; } } } $array = array(new Dummy()); $array[] = "xxx"; register_shutdown_function(function() use($array) { global $flag; $flag = 0; var_dump(json_encode(array($array))); }); $flag = 1; var_dump(json_encode(array($array)));

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.60.0120.00318.50
8.3.50.0130.01018.17
8.3.40.0100.01019.09
8.3.30.0070.00718.73
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0070.00026.16
8.2.180.0040.01125.92
8.2.170.0130.00722.96
8.2.160.0070.00722.96
8.2.150.0070.00025.66
8.2.140.0070.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00821.07
8.2.110.0030.00619.27
8.2.100.0000.01118.03
8.2.90.0000.00818.22
8.2.80.0000.00818.22
8.2.70.0040.00417.63
8.2.60.0080.00017.63
8.2.50.0030.00618.07
8.2.40.0000.00819.88
8.2.30.0080.00018.13
8.2.20.0040.00418.09
8.2.10.0040.00419.39
8.2.00.0040.00419.35
8.1.280.0070.01025.92
8.1.270.0000.00823.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00823.79
8.1.230.0080.00320.89
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0030.00517.23
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0060.00318.54
8.1.160.0040.00418.90
8.1.150.0020.00518.79
8.1.140.0000.00818.89
8.1.130.0060.00317.46
8.1.120.0100.00017.46
8.1.110.0050.00217.42
8.1.100.0050.00217.49
8.1.90.0000.00717.35
8.1.80.0030.00617.47
8.1.70.0040.00417.39
8.1.60.0040.00717.49
8.1.50.0000.00917.50
8.1.40.0080.00017.51
8.1.30.0030.00617.68
8.1.20.0000.00817.52
8.1.10.0110.00317.56
8.1.00.0040.00417.52
8.0.300.0000.00820.04
8.0.290.0000.00716.75
8.0.280.0030.00318.55
8.0.270.0040.00417.94
8.0.260.0080.00016.93
8.0.250.0030.00516.99
8.0.240.0030.00517.05
8.0.230.0000.00816.93
8.0.220.0030.00316.99
8.0.210.0030.00316.83
8.0.200.0030.00316.99
8.0.190.0050.00317.05
8.0.180.0000.00717.04
8.0.170.0060.00316.98
8.0.160.0040.00416.98
8.0.150.0000.00716.91
8.0.140.0000.00716.83
8.0.130.0060.00013.31
8.0.120.0040.00416.89
8.0.110.0050.00216.90
8.0.100.0000.00716.77
8.0.90.0040.00416.80
8.0.80.0120.00516.89
8.0.70.0000.00816.75
8.0.60.0000.00817.02
8.0.50.0000.00716.95
8.0.30.0100.00716.84
8.0.20.0130.00316.94
8.0.10.0070.01617.14
8.0.00.0000.01617.06
7.4.330.0060.00016.89
7.4.320.0030.00316.47
7.4.300.0030.00316.50
7.4.290.0040.00416.46
7.4.280.0040.00416.61
7.4.270.0030.00416.58
7.4.260.0030.00313.27
7.4.250.0030.00316.61
7.4.240.0050.00216.59
7.4.230.0030.00316.53
7.4.220.0050.00216.56
7.4.210.0080.00716.49
7.4.200.0050.00216.70
7.4.160.0100.00716.62
7.4.150.0130.00716.68
7.4.140.0090.00616.49
7.4.130.0060.00916.55
7.4.120.0060.00916.49
7.4.110.0140.00316.48
7.4.100.0040.01216.70
7.4.90.0080.00816.54
7.4.80.0030.01416.54
7.4.70.0000.01516.50
7.4.60.0080.00716.50
7.4.50.0060.00916.27
7.4.40.0080.00516.40
7.4.30.0040.01116.50
7.4.20.0090.01116.64
7.4.10.0130.00316.48
7.4.00.0030.01216.46
7.3.330.0000.00716.31
7.3.320.0080.00013.20
7.3.310.0040.00316.35
7.3.300.0070.00016.22
7.3.290.0080.00916.38
7.3.270.0000.01516.44
7.3.260.0100.00516.43
7.3.250.0080.00816.37
7.3.240.0100.00316.38
7.3.230.0110.00616.37
7.3.220.0110.00316.29
7.3.210.0060.00916.27
7.3.200.0030.01216.29
7.3.190.0150.00616.27
7.3.180.0030.01016.35
7.3.170.0030.01116.35
7.3.160.0000.01316.31
7.3.150.0050.01016.28
7.3.140.0040.01116.32
7.3.130.0060.00916.26
7.3.120.0110.00716.30
7.3.110.0140.00416.15
7.3.100.0090.00616.15
7.3.90.0040.01016.58
7.3.80.0070.01116.28
7.3.70.0070.00716.32
7.3.60.0070.01116.40
7.3.50.0180.00016.43
7.3.40.0110.00716.37
7.3.30.0120.00616.43
7.3.20.0090.00616.45
7.3.10.0040.01216.40
7.3.00.0050.00916.35

preferences:
30.5 ms | 400 KiB | 5 Q