3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Foo { public function add($val = 0) { $this->stuff[] = $val; } } $x = new Foo(); $x->add(42); echo serialize($x) . "\n"; var_dump($x); echo "\n\n"; class Bar { private $stuff = []; public function add($x = 0) { $this->stuff[] = $x; } } $x = new Bar(); $x->add(42); echo serialize($x) . "\n"; var_dump($x);

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.5.30.0090.00920.55
8.5.20.0100.00921.23
8.5.10.0090.00920.20
8.5.00.0100.01324.44
8.4.180.0130.00920.55
8.4.170.0130.00823.96
8.4.160.0140.00722.17
8.4.150.0080.00216.80
8.4.140.0120.01017.55
8.4.130.0110.00818.77
8.4.120.0080.00323.82
8.4.110.0120.00718.77
8.4.100.0100.01218.05
8.4.90.0060.00320.54
8.4.80.0110.00818.91
8.4.70.0050.00320.72
8.4.60.0050.00318.63
8.4.50.0090.00722.55
8.4.40.0060.01219.77
8.4.30.0160.00320.48
8.4.20.0120.01217.84
8.4.10.0000.00923.68
8.3.300.0160.00618.55
8.3.290.0150.00520.91
8.3.280.0140.00818.38
8.3.270.0150.01016.54
8.3.260.0050.00316.91
8.3.250.0100.00819.07
8.3.240.0090.01017.31
8.3.230.0100.00916.71
8.3.220.0110.00819.12
8.3.210.0120.00816.93
8.3.200.0060.00316.82
8.3.190.0090.01016.88
8.3.180.0160.00416.75
8.3.170.0030.01520.97
8.3.160.0060.00318.50
8.3.150.0160.00317.18
8.3.140.0000.00817.10
8.3.130.0000.00818.74
8.3.120.0100.01018.98
8.3.110.0070.01320.94
8.3.100.0110.00824.06
8.3.90.0000.00926.77
8.3.80.0060.00318.55
8.3.70.0140.00716.88
8.3.60.0110.00716.75
8.3.50.0100.01020.48
8.3.40.0100.00321.91
8.3.30.0130.00618.79
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.300.0120.00922.16
8.2.290.0120.00820.52
8.2.280.0130.00720.30
8.2.270.0110.00717.24
8.2.260.0000.00818.80
8.2.250.0060.01216.90
8.2.240.0170.00017.37
8.2.230.0080.00022.58
8.2.220.0090.00037.54
8.2.210.0120.00626.77
8.2.200.0090.00016.63
8.2.190.0120.00916.63
8.2.180.0130.00725.92
8.2.170.0180.00019.21
8.2.160.0070.01022.96
8.2.150.0000.00725.66
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00419.89
8.2.110.0100.00020.47
8.2.100.0040.00817.84
8.2.90.0050.00319.35
8.2.80.0000.00818.03
8.2.70.0030.00517.63
8.2.60.0000.00818.04
8.2.50.0000.00818.07
8.2.40.0030.00618.34
8.2.30.0050.00318.11
8.2.20.0000.00720.48
8.2.10.0000.00817.91
8.2.00.0000.00719.11
8.1.340.0140.00823.71
8.1.330.0110.00721.96
8.1.320.0100.00916.22
8.1.310.0070.00718.44
8.1.300.0040.00418.55
8.1.290.0090.00030.84
8.1.280.0000.01625.92
8.1.270.0040.00423.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0000.00918.92
8.1.230.0040.00717.76
8.1.220.0040.00417.79
8.1.210.0030.00518.77
8.1.200.0050.00517.35
8.1.190.0050.00317.35
8.1.180.0080.00018.10
8.1.170.0080.00018.59
8.1.160.0040.00418.88
8.1.150.0040.00418.63
8.1.140.0030.00617.36
8.1.130.0030.00318.80
8.1.120.0000.00717.36
8.1.110.0000.00817.41
8.1.100.0030.00617.46
8.1.90.0040.00417.49
8.1.80.0040.00417.30
8.1.70.0120.00517.42
8.1.60.0160.00317.59
8.1.50.0140.00417.50
8.1.40.0070.01117.39
8.1.30.0120.00617.66
8.1.20.0040.01317.50
8.1.10.0140.00417.52
8.1.00.0080.01217.50
8.0.300.0000.00718.77
8.0.290.0000.00916.63
8.0.280.0080.00020.25
8.0.270.0000.00718.06
8.0.260.0000.00618.34
8.0.250.0000.00716.86
8.0.240.0080.00016.93
8.0.230.0030.00716.96
8.0.220.0000.00816.93
8.0.210.0130.00316.69
8.0.200.0090.00316.89
8.0.190.0050.00316.76
8.0.180.0110.00016.76
8.0.170.0070.00816.78
8.0.160.0080.00516.74
8.0.150.0070.00416.68
8.0.140.0080.00816.71
8.0.130.0110.00516.71
8.0.120.0160.00016.86
8.0.110.0080.00516.82
8.0.100.0130.00316.79
8.0.90.0120.00416.68
8.0.80.0060.00616.74
8.0.70.0110.00416.71
8.0.60.0120.00316.63
8.0.50.0150.00016.76
8.0.30.0050.01016.84
8.0.20.0000.01516.76
8.0.10.0100.00516.74
7.4.330.0050.00015.55
7.4.320.0000.00616.58
7.4.300.0100.00016.56
7.4.290.0130.00316.59
7.4.280.0120.00416.61
7.4.270.0150.00316.45
7.4.260.0140.00516.50
7.4.250.0110.00816.53
7.4.240.0130.00416.51
7.4.230.0140.00316.49
7.4.220.0130.00316.49
7.4.210.0160.00016.48
7.4.200.0170.00016.38
7.4.190.0150.00016.45
7.4.180.0000.00916.66
7.4.160.0050.00316.57
7.4.150.0090.00316.48
7.4.140.0100.00316.34
7.4.130.0100.00716.49
7.4.120.0040.01216.53
7.4.110.0090.00216.34
7.4.100.0080.00316.41
7.4.90.0110.00016.31
7.4.80.0090.00316.43
7.4.70.0090.00616.46
7.4.60.0120.00216.32
7.4.50.0140.00016.34
7.4.40.0090.00516.24
7.4.30.0110.00316.26
7.4.20.0080.00816.52
7.4.10.0120.00316.48
7.4.00.0120.00916.40

preferences:
56.54 ms | 1288 KiB | 5 Q