3v4l.org

run code in 300+ PHP versions simultaneously
<?php class friendList { private $friends; public function __construct(array $names){ $this->friends = []; if($names) foreach($names as $name) $this->addFriend($name); } public function addFriend($name) { $this->friends[] = $name; } public function getFriends() { return $this->friends; } } $friends = new friendList(['Eric','Dan','Lisa']); function funtimes($friends) { echo implode(", ", $friends->getFriends()) . "\n"; $friends->addFriend('John'); } funtimes($friends); var_dump($friends);

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.0110.00418.27
8.3.50.0180.00722.89
8.3.40.0070.00718.80
8.3.30.0060.00918.87
8.3.20.0080.00020.21
8.3.10.0040.00423.69
8.3.00.0040.00417.50
8.2.180.0060.00916.63
8.2.170.0110.00422.96
8.2.160.0100.00320.39
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00021.09
8.2.110.0030.00721.98
8.2.100.0080.00318.22
8.2.90.0080.00319.25
8.2.80.0050.00317.97
8.2.70.0110.00317.50
8.2.60.0000.00717.93
8.2.50.0080.00018.07
8.2.40.0030.00519.88
8.2.30.0040.00418.18
8.2.20.0070.00017.80
8.2.10.0040.00418.04
8.2.00.0030.00617.80
8.1.280.0120.00625.92
8.1.270.0030.00623.92
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0090.00023.84
8.1.230.0100.00319.11
8.1.220.0050.00317.76
8.1.210.0000.00818.77
8.1.200.0040.00417.22
8.1.190.0050.00317.35
8.1.180.0030.00518.10
8.1.170.0090.00018.59
8.1.160.0020.00522.04
8.1.150.0000.00818.89
8.1.140.0040.00417.41
8.1.130.0070.00017.46
8.1.120.0040.00317.48
8.1.110.0080.00017.42
8.1.100.0070.00017.47
8.1.90.0030.00517.52
8.1.80.0040.00417.37
8.1.70.0000.00717.34
8.1.60.0000.00817.56
8.1.50.0030.00517.41
8.1.40.0080.00017.56
8.1.30.0000.00917.47
8.1.20.0000.00817.65
8.1.10.0040.00417.54
8.1.00.0000.00917.36
8.0.300.0000.00718.77
8.0.290.0000.00716.63
8.0.280.0040.00418.36
8.0.270.0040.00417.20
8.0.260.0040.00416.82
8.0.250.0070.00016.82
8.0.240.0000.00816.99
8.0.230.0070.00016.88
8.0.220.0020.00516.75
8.0.210.0030.00316.91
8.0.200.0040.00416.87
8.0.190.0070.00016.81
8.0.180.0050.00316.91
8.0.170.0040.00416.94
8.0.160.0070.00016.77
8.0.150.0040.00416.65
8.0.140.0040.00416.71
8.0.130.0030.00313.33
8.0.120.0040.00416.79
8.0.110.0000.00816.81
8.0.100.0040.00416.75
8.0.90.0000.00816.84
8.0.80.0060.01116.87
8.0.70.0040.00416.80
8.0.60.0040.00416.78
8.0.50.0040.00416.85
8.0.30.0110.01317.17
8.0.20.0110.00917.40
8.0.10.0050.00317.09
8.0.00.0100.00716.86
7.4.330.0050.00015.00
7.4.320.0000.00716.60
7.4.300.0060.00016.41
7.4.290.0000.00716.42
7.4.280.0020.00816.50
7.4.270.0000.00716.39
7.4.260.0040.00716.47
7.4.250.0040.00416.54
7.4.240.0040.00416.63
7.4.230.0030.00316.33
7.4.220.0120.00616.66
7.4.210.0120.00616.64
7.4.200.0030.00316.25
7.4.160.0060.01016.54
7.4.150.0120.00617.40
7.4.140.0110.00617.86
7.4.130.0110.00916.55
7.4.120.0100.01016.55
7.4.110.0140.00316.41
7.4.100.0130.00316.68
7.4.90.0100.00616.48
7.4.80.0060.01119.39
7.4.70.0080.00816.56
7.4.60.0030.01316.62
7.4.50.0000.00616.55
7.4.40.0080.00816.38
7.4.30.0100.00616.56
7.4.00.0040.01115.17
7.3.330.0000.00713.20
7.3.320.0030.00313.29
7.3.310.0070.00016.29
7.3.300.0070.00016.29
7.3.290.0100.00616.31
7.3.280.0100.01016.23
7.3.270.0070.01717.40
7.3.260.0110.01216.48
7.3.250.0080.01016.45
7.3.240.0180.00516.53
7.3.230.0100.01016.46
7.3.210.0100.00716.40
7.3.200.0110.00619.39
7.3.190.0030.01216.35
7.3.180.0060.00916.55
7.3.170.0030.01216.36
7.3.160.0090.00616.54
7.2.330.0100.01016.85
7.2.320.0110.00616.82
7.2.310.0070.01016.57
7.2.300.0110.00816.50
7.2.290.0110.00816.68
7.2.110.0160.00316.67
7.2.60.0070.00716.97
7.2.00.0060.00619.52
7.1.200.0070.00715.79
7.1.100.0040.00818.34
7.1.70.0000.00717.34
7.1.60.0070.01719.40
7.1.50.0000.01216.98
7.1.00.0030.07322.27
7.0.200.0630.00714.77
7.0.140.0000.08022.11
7.0.120.0000.07722.26
7.0.110.0130.06722.01
7.0.100.0000.07721.96
7.0.90.0100.06721.99
7.0.80.0030.07322.04
7.0.70.0000.07722.11
7.0.60.0100.06722.10
7.0.50.0030.07322.21
7.0.40.0030.07022.12
7.0.30.0030.07322.03
7.0.20.0030.07322.17
7.0.10.0000.06321.97
7.0.00.0000.07322.06
5.6.280.0000.07720.90
5.6.260.0070.06720.80
5.6.250.0170.06021.10
5.6.240.0030.07021.00
5.6.230.0030.06321.10
5.6.220.0030.07021.02
5.6.210.0070.06720.98
5.6.200.0000.07720.76
5.6.190.0030.07720.87
5.6.180.0000.07720.95
5.6.170.0000.07720.84
5.6.160.0030.06021.08
5.6.150.0000.08021.04
5.6.140.0000.08021.09
5.6.130.0000.07321.01
5.6.120.0070.07320.83
5.6.110.0030.07720.94
5.6.100.0070.07321.05
5.6.90.0000.07720.84
5.6.80.0070.05720.42
5.6.70.0030.07020.46
5.6.60.0070.06720.38
5.6.50.0070.06720.45
5.6.40.0030.07020.21
5.6.30.0030.07020.42
5.6.20.0170.06020.40
5.6.10.0070.06320.42
5.6.00.0030.06720.20
5.5.380.0030.07017.70
5.5.370.0030.06717.73
5.5.360.0000.07717.53
5.5.350.0000.07017.55
5.5.340.0000.07317.91
5.5.330.0070.07018.23
5.5.320.0070.07018.23
5.5.310.0030.07317.93
5.5.300.0000.06717.95
5.5.290.0030.07317.96
5.5.280.0000.07318.09
5.5.270.0070.06318.07
5.5.260.0000.08018.12
5.5.250.0070.06717.91
5.5.240.0070.06017.48
5.5.230.0070.06317.47
5.5.220.0030.06717.21
5.5.210.0070.06317.21
5.5.200.0000.06317.48
5.5.190.0030.07017.40
5.5.180.0030.07017.48
5.5.160.0000.07017.58
5.5.150.0030.06717.46
5.5.140.0030.06717.57
5.5.130.0070.06317.45
5.5.120.0000.07017.27
5.5.110.0030.06317.27
5.5.100.0000.07317.49
5.5.90.0100.06017.20
5.5.80.0030.06717.48
5.5.70.0030.07017.34
5.5.60.0000.06017.33
5.5.50.0000.07017.15
5.5.40.0070.05717.47
5.5.30.0030.06717.49
5.5.20.0000.07017.16
5.5.10.0030.07017.15
5.5.00.0000.07317.32
5.4.450.0030.07319.30
5.4.440.0030.07019.34
5.4.430.0000.06719.32
5.4.420.0000.06719.32
5.4.410.0070.06719.37
5.4.400.0000.07018.98
5.4.390.0000.07319.01
5.4.380.0030.06718.95
5.4.370.0000.07019.22
5.4.360.0070.06719.33
5.4.350.0070.06019.15
5.4.340.0070.06319.00
5.4.320.0000.07319.14
5.4.310.0070.06319.18
5.4.300.0030.06319.13
5.4.290.0000.06719.02
5.4.280.0000.07318.98
5.4.270.0000.06719.00
5.4.260.0070.06319.32
5.4.250.0000.07019.23
5.4.240.0030.06718.99
5.4.230.0000.07019.25
5.4.220.0030.07019.21
5.4.210.0030.06719.23
5.4.200.0070.06318.97
5.4.190.0100.06019.16
5.4.180.0030.06718.93
5.4.170.0000.06719.00
5.4.160.0030.06719.31
5.4.150.0070.06719.20
5.4.140.0000.07016.43
5.4.130.0070.06016.39
5.4.120.0100.07016.39
5.4.110.0000.07016.59
5.4.100.0070.06016.62
5.4.90.0030.06316.55
5.4.80.0030.06316.24
5.4.70.0000.05316.50
5.4.60.0070.05716.60
5.4.50.0000.06716.53
5.4.40.0000.06316.59
5.4.30.0030.06316.39
5.4.20.0000.06716.51
5.4.10.0030.06316.43
5.4.00.0030.06315.79
5.3.290.0070.06714.76
5.3.280.0030.06714.63
5.3.270.0000.07014.69
5.3.260.0000.07314.61
5.3.250.0030.06314.68
5.3.240.0000.07014.61
5.3.230.0070.06314.60
5.3.220.0030.06014.65
5.3.210.0000.07314.70
5.3.200.0000.07014.57
5.3.190.0030.05714.56
5.3.180.0000.06714.79
5.3.170.0030.05714.42
5.3.160.0000.06714.57
5.3.150.0070.06314.57
5.3.140.0030.06314.54
5.3.130.0000.07314.53
5.3.120.0070.06314.51
5.3.110.0030.06714.50
5.3.100.0030.05314.04
5.3.90.0070.06314.11
5.3.80.0030.06314.03
5.3.70.0070.06314.08
5.3.60.0000.06313.99
5.3.50.0000.06713.94
5.3.40.0030.06313.91
5.3.30.0030.06313.93
5.3.20.0030.05713.83
5.3.10.0030.06313.66
5.3.00.0000.07013.77
5.2.170.0000.05711.14
5.2.160.0100.04711.16
5.2.150.0000.05711.17
5.2.140.0000.05711.27
5.2.130.0000.05711.16
5.2.120.0030.05010.95
5.2.110.0000.04711.10
5.2.100.0030.04711.18
5.2.90.0000.05311.23
5.2.80.0000.05011.16
5.2.70.0070.05311.23
5.2.60.0000.05311.03
5.2.50.0000.05311.08
5.2.40.0030.04011.00
5.2.30.0000.05711.10
5.2.20.0030.04711.09
5.2.10.0030.04711.01
5.2.00.0000.05310.69
5.1.60.0000.04710.07
5.1.50.0000.0479.97
5.1.40.0000.04310.05
5.1.30.0030.05010.35
5.1.20.0000.05010.32
5.1.10.0030.04710.04
5.1.00.0030.04310.15
5.0.50.0000.0409.75
5.0.40.0030.0339.75
5.0.30.0030.0579.75
5.0.20.0030.0379.75
5.0.10.0030.0379.75
5.0.00.0000.0609.75
4.4.90.0000.0339.75
4.4.80.0000.0309.75
4.4.70.0070.0279.75
4.4.60.0000.0279.75
4.4.50.0000.0309.75
4.4.40.0000.0479.75
4.4.30.0000.0279.75
4.4.20.0030.0309.75
4.4.10.0000.0339.75
4.4.00.0000.0479.75
4.3.110.0070.0279.75
4.3.100.0000.0279.75
4.3.90.0000.0309.75
4.3.80.0000.0479.75
4.3.70.0000.0239.75
4.3.60.0000.0309.75
4.3.50.0000.0279.75
4.3.40.0030.0439.75
4.3.30.0100.0239.75
4.3.20.0030.0309.75
4.3.10.0000.0309.75
4.3.00.0000.0309.75

preferences:
48.76 ms | 401 KiB | 5 Q