3v4l.org

run code in 300+ PHP versions simultaneously
<?php date_default_timezone_set('America/Los_Angeles'); class Fruit implements JsonSerializable { public $type = 'Apple', $lastEaten = null; public function __construct() { $this->lastEaten = new DateTime(); } public function jsonSerialize() { return array( 'type' => $this->type, 'lastEaten' => $this->lastEaten->format(DateTime::ISO8601) ); } } echo $s = json_encode(new Fruit()); var_dump(json_decode($s));

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.0100.01018.80
8.3.50.0140.00722.03
8.3.40.0110.00418.98
8.3.30.0110.00419.34
8.3.20.0000.00720.34
8.3.10.0030.00622.04
8.3.00.0050.00322.37
8.2.180.0090.00616.47
8.2.170.0130.00322.96
8.2.160.0120.00321.07
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0050.00317.88
8.2.110.0100.00022.10
8.2.100.0120.00017.84
8.2.90.0000.00819.36
8.2.80.0070.00318.04
8.2.70.0100.00317.88
8.2.60.0030.00618.05
8.2.50.0080.00018.07
8.2.40.0040.00418.41
8.2.30.0000.00818.18
8.2.20.0030.00517.93
8.2.10.0070.00017.92
8.2.00.0070.00017.83
8.1.280.0120.00325.92
8.1.270.0040.00423.92
8.1.260.0080.00026.35
8.1.250.0110.00728.09
8.1.240.0090.00023.81
8.1.230.0040.00719.15
8.1.220.0000.00817.89
8.1.210.0000.00818.77
8.1.200.0060.00317.60
8.1.190.0030.00517.39
8.1.180.0040.00418.10
8.1.170.0060.00318.62
8.1.160.0040.00421.90
8.1.150.0050.00318.80
8.1.140.0030.00617.65
8.1.130.0030.00317.78
8.1.120.0040.00417.58
8.1.110.0050.00317.62
8.1.100.0000.00717.68
8.1.90.0060.00317.59
8.1.80.0030.00617.59
8.1.70.0030.00317.54
8.1.60.0000.00817.75
8.1.50.0000.00817.67
8.1.40.0000.00717.55
8.1.30.0030.00617.80
8.1.20.0050.00317.86
8.1.10.0000.00817.61
8.1.00.0000.00817.62
8.0.300.0040.00418.77
8.0.290.0000.00717.18
8.0.280.0030.00318.54
8.0.270.0000.00717.34
8.0.260.0030.00317.01
8.0.250.0030.00317.03
8.0.240.0030.00317.09
8.0.230.0050.00317.17
8.0.220.0040.00416.97
8.0.210.0070.00017.14
8.0.200.0000.00717.16
8.0.190.0080.00017.18
8.0.180.0040.00417.11
8.0.170.0070.00017.19
8.0.160.0030.00517.09
8.0.150.0030.00317.06
8.0.140.0070.00017.12
8.0.130.0030.00713.57
8.0.120.0000.00717.04
8.0.110.0040.00417.12
8.0.100.0000.00716.90
8.0.90.0030.00517.00
8.0.80.0100.00717.14
8.0.70.0030.00516.90
8.0.60.0040.00416.93
8.0.50.0040.00417.04
8.0.30.0110.00817.30
8.0.20.0100.00817.40
8.0.10.0030.00517.18
8.0.00.0120.01016.96
7.4.330.0050.00015.21
7.4.320.0030.00316.67
7.4.300.0000.00716.70
7.4.290.0070.00016.72
7.4.280.0030.00516.70
7.4.270.0030.00316.68
7.4.260.0040.00716.72
7.4.250.0050.00216.71
7.4.240.0030.00516.71
7.4.230.0030.00316.46
7.4.220.0030.01316.78
7.4.210.0080.00916.69
7.4.200.0030.00516.84
7.4.190.0070.00016.80
7.4.160.0090.00916.63
7.4.150.0090.00917.40
7.4.140.0140.00817.86
7.4.130.0140.01416.64
7.4.120.0100.00916.71
7.4.110.0210.00016.81
7.4.100.0090.01016.76
7.4.90.0100.00716.60
7.4.80.0140.00816.77
7.4.70.0060.01016.80
7.4.60.0060.00916.55
7.4.50.0040.00416.50
7.4.40.0030.01022.77
7.4.30.0090.00916.77
7.4.00.0110.00315.16
7.3.330.0020.00213.44
7.3.320.0030.00313.44
7.3.310.0070.00016.36
7.3.300.0070.00016.45
7.3.290.0070.00716.46
7.3.280.0100.00816.44
7.3.270.0140.00417.40
7.3.260.0160.01016.59
7.3.250.0090.01116.69
7.3.240.0130.00416.63
7.3.230.0090.01216.73
7.3.210.0120.00616.64
7.3.200.0120.00919.39
7.3.190.0030.01416.74
7.3.180.0060.00916.59
7.3.170.0050.01116.53
7.3.160.0000.01716.74
7.3.120.0100.00615.11
7.2.330.0160.00316.61
7.2.320.0060.01217.00
7.2.310.0060.00916.67
7.2.300.0070.01017.00
7.2.290.0120.00616.87
7.2.60.0090.00616.97
7.2.00.0030.01019.35
7.1.200.0060.00615.91
7.1.100.0110.00418.39
7.1.70.0050.00317.45
7.1.60.0090.01519.82
7.1.50.0100.01017.18
7.1.00.0030.07722.27
7.0.200.0080.00816.83
7.0.140.0030.07322.04
7.0.90.0570.06019.98
7.0.80.0430.07319.87
7.0.70.0500.04319.99
7.0.60.0500.05019.98
7.0.50.0600.08020.30
7.0.40.0130.08020.11
7.0.30.0070.04320.07
7.0.20.0130.05020.05
7.0.10.0130.04020.09
7.0.00.0000.04719.94
5.6.280.0070.07020.78
5.6.240.0130.07320.77
5.6.230.0130.07320.60
5.6.220.0100.08020.59
5.6.210.0030.04320.66
5.6.200.0000.08021.07
5.6.190.0030.04721.08
5.6.180.0030.06321.02
5.6.170.0130.03320.94
5.6.160.0130.07721.03
5.6.150.0070.08320.96
5.6.140.0070.06020.95
5.6.130.0100.08321.18
5.6.120.0100.07721.03
5.6.110.0070.04720.93
5.6.100.0100.06321.01
5.6.90.0100.07021.02
5.6.80.0030.07720.57
5.6.70.0070.05020.39
5.6.60.0030.05720.39
5.6.50.0100.07720.49
5.6.40.0170.03720.47
5.6.30.0070.07720.27
5.6.20.0100.07320.37
5.6.10.0100.05720.32
5.6.00.0070.04020.48
5.5.380.0230.06020.50
5.5.370.0130.04320.41
5.5.360.0170.07720.36
5.5.350.0030.08720.46
5.5.340.0130.04320.87
5.5.330.0000.05720.84
5.5.320.0100.06020.81
5.5.310.0100.04020.84
5.5.300.0030.07020.93
5.5.290.0000.07720.91
5.5.280.0130.07720.87
5.5.270.0070.08020.76
5.5.260.0130.07720.88
5.5.250.0130.07720.59
5.5.240.0030.08720.31
5.5.230.0070.09720.18
5.5.220.0130.07020.23
5.5.210.0100.07320.29
5.5.200.0130.06720.12
5.5.190.0130.06720.21
5.5.180.0070.04720.21
5.5.160.0070.08020.08
5.5.150.0000.08720.24
5.5.140.0070.05720.08
5.5.130.0070.06719.99
5.5.120.0030.08020.23
5.5.110.0100.07720.18
5.5.100.0170.06320.07
5.5.90.0100.07320.13
5.5.80.0170.06020.11
5.5.70.0100.05720.00
5.5.60.0130.07020.07
5.5.50.0030.08020.10
5.5.40.0070.09020.05
5.5.30.0030.06719.90
5.5.20.0030.08719.93
5.5.10.0030.08020.11
5.5.00.0200.05019.97
5.4.450.0070.05719.27
5.4.440.0100.05019.20
5.4.430.0070.03719.37
5.4.420.0100.08019.38
5.4.410.0130.05319.23
5.4.400.0030.07718.90
5.4.390.0030.04019.04
5.4.380.0100.06319.13
5.4.370.0070.04018.90
5.4.360.0070.07019.13
5.4.350.0030.04719.03
5.4.340.0070.06719.02
5.4.320.0100.07319.09
5.4.310.0030.08019.04
5.4.300.0100.07019.23
5.4.290.0130.07018.84
5.4.280.0070.07319.02
5.4.270.0070.07718.98
5.4.260.0070.04719.12
5.4.250.0100.06019.20
5.4.240.0030.04019.15
5.4.230.0070.06718.88
5.4.220.0000.07719.13
5.4.210.0030.06019.17
5.4.200.0200.06718.84
5.4.190.0000.06719.14
5.4.180.0070.06319.13
5.4.170.0070.06718.89
5.4.160.0070.04719.10
5.4.150.0070.06018.92
5.4.140.0200.06316.35
5.4.130.0130.05716.42
5.4.120.0100.07016.42
5.4.110.0170.07316.48
5.4.100.0030.07016.39
5.4.90.0070.06016.44
5.4.80.0030.03716.45
5.4.70.0100.06316.55
5.4.60.0030.05316.45
5.4.50.0000.04716.40
5.4.40.0100.06716.38
5.4.30.0000.04716.36
5.4.20.0070.04016.36
5.4.10.0100.05316.45
5.4.00.0030.07015.59
5.3.290.0000.08714.68
5.3.280.0070.07314.58
5.3.270.0030.08014.54
5.3.260.0000.07714.57
5.3.250.0100.07314.58
5.3.240.0000.07714.63
5.3.230.0100.04314.63
5.3.220.0030.06714.60
5.3.210.0030.05314.52
5.3.200.0070.05714.49
5.3.190.0200.06014.66
5.3.180.0030.04314.63
5.3.170.0030.07714.62
5.3.160.0070.03314.54
5.3.150.0070.04014.62
5.3.140.0100.06714.63
5.3.130.0070.06714.61
5.3.120.0070.04014.52
5.3.110.0100.07014.63
5.3.100.0030.08014.13
5.3.90.0030.04713.92
5.3.80.0100.04013.92
5.3.70.0170.04014.04
5.3.60.0030.06014.11
5.3.50.0030.07713.94
5.3.40.0070.06313.96
5.3.30.0100.06013.89
5.3.20.0170.06313.71
5.3.10.0030.05313.64
5.3.00.0030.08013.72
5.2.170.0030.05311.21
5.2.160.0030.06311.07
5.2.150.0030.05011.18
5.2.140.0100.05711.21
5.2.130.0070.06011.14
5.2.120.0070.06011.17
5.2.110.0070.03011.16
5.2.100.0030.05011.21
5.2.90.0070.05311.17
5.2.80.0030.05011.24
5.2.70.0130.04311.12
5.2.60.0030.06310.93
5.2.50.0130.05311.04
5.2.40.0030.05711.05
5.2.30.0170.04311.08
5.2.20.0000.07011.05
5.2.10.0000.05010.78
5.2.00.0070.06010.64
5.1.60.0070.04710.10
5.1.50.0070.04010.12
5.1.40.0030.0539.98
5.1.30.0070.04010.41
5.1.20.0030.03310.48
5.1.10.0130.05010.15
5.1.00.0070.05010.06
5.0.50.0000.0508.54
5.0.40.0000.0338.48
5.0.30.0000.0438.24
5.0.20.0070.0408.20
5.0.10.0070.0308.25
5.0.00.0000.0678.05
4.4.90.0030.0237.06
4.4.80.0000.0377.06
4.4.70.0000.0377.06
4.4.60.0000.0377.06
4.4.50.0100.0277.06
4.4.40.0030.0537.06
4.4.30.0000.0407.06
4.4.20.0030.0377.06
4.4.10.0070.0277.06
4.4.00.0000.0577.06
4.3.110.0100.0237.06
4.3.100.0070.0307.06
4.3.90.0030.0337.06
4.3.80.0000.0507.06
4.3.70.0030.0177.06
4.3.60.0070.0307.06
4.3.50.0030.0307.06
4.3.40.0000.0437.06
4.3.30.0000.0337.06
4.3.20.0000.0377.06
4.3.10.0000.0377.06
4.3.00.0000.0337.06

preferences:
48.15 ms | 401 KiB | 5 Q