3v4l.org

run code in 300+ PHP versions simultaneously
<?php class friendList { private $friends; public function __construct(array $names=[]){ $this->friends = []; 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()); $this->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.43
8.3.50.0200.01322.75
8.3.40.0090.00618.96
8.3.30.0090.00619.13
8.3.20.0070.00020.30
8.3.10.0040.00423.66
8.3.00.0030.00617.75
8.2.180.0120.00316.50
8.2.170.0140.00722.96
8.2.160.0070.01320.57
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0070.00020.97
8.2.110.0060.00321.06
8.2.100.0140.00318.16
8.2.90.0030.00619.30
8.2.80.0040.00417.97
8.2.70.0080.00317.63
8.2.60.0030.00518.03
8.2.50.0050.00318.07
8.2.40.0040.00418.34
8.2.30.0030.00518.16
8.2.20.0040.00417.84
8.2.10.0000.00717.97
8.2.00.0040.00417.90
8.1.280.0090.00625.92
8.1.270.0090.00023.85
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00323.95
8.1.230.0090.00319.06
8.1.220.0040.00417.76
8.1.210.0030.00518.77
8.1.200.0000.00917.48
8.1.190.0080.00017.36
8.1.180.0030.00618.10
8.1.170.0000.00918.57
8.1.160.0050.00221.93
8.1.150.0000.00718.88
8.1.140.0060.00317.50
8.1.130.0030.00317.86
8.1.120.0040.00417.47
8.1.110.0040.00417.48
8.1.100.0000.00717.34
8.1.90.0040.00417.42
8.1.80.0050.00217.35
8.1.70.0040.00417.41
8.1.60.0050.00517.47
8.1.50.0030.00517.55
8.1.40.0030.00617.39
8.1.30.0000.00917.57
8.1.20.0040.00417.62
8.1.10.0040.00417.46
8.1.00.0080.00017.58
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00718.31
8.0.270.0000.00717.13
8.0.260.0030.00317.25
8.0.250.0050.00217.08
8.0.240.0000.00816.90
8.0.230.0000.00716.90
8.0.220.0000.00716.97
8.0.210.0030.00316.84
8.0.200.0060.00016.90
8.0.190.0050.00317.03
8.0.180.0050.00216.98
8.0.170.0040.00416.87
8.0.160.0000.00716.89
8.0.150.0080.00016.93
8.0.140.0030.00316.83
8.0.130.0060.00013.40
8.0.120.0040.00416.91
8.0.110.0040.00416.77
8.0.100.0000.00716.93
8.0.90.0000.00716.79
8.0.80.0060.00916.81
8.0.70.0040.00416.96
8.0.60.0020.00516.92
8.0.50.0000.00816.85
8.0.30.0120.00917.13
8.0.20.0110.00917.40
8.0.10.0040.00416.88
8.0.00.0080.01316.83
7.4.330.0000.00515.07
7.4.320.0030.00316.51
7.4.300.0000.00816.64
7.4.290.0000.00716.45
7.4.280.0070.00316.64
7.4.270.0070.00016.62
7.4.260.0030.00616.47
7.4.250.0070.00016.46
7.4.240.0040.00316.57
7.4.230.0070.00016.70
7.4.220.0040.01516.53
7.4.210.0090.00616.64
7.4.200.0040.00416.39
7.4.160.0080.00816.49
7.4.150.0070.01417.40
7.4.140.0090.00817.86
7.4.130.0110.00816.61
7.4.120.0080.01016.44
7.4.110.0070.01016.55
7.4.100.0120.00916.49
7.4.90.0100.00616.70
7.4.80.0080.00919.39
7.4.70.0080.00816.60
7.4.60.0100.00716.33
7.4.50.0020.00216.26
7.4.40.0130.00316.54
7.4.30.0140.00316.55
7.4.00.0090.00814.99
7.3.330.0030.00313.36
7.3.320.0030.00313.13
7.3.310.0030.00316.29
7.3.300.0040.00416.31
7.3.290.0030.01016.28
7.3.280.0100.01016.34
7.3.270.0070.01117.40
7.3.260.0120.00816.48
7.3.250.0100.00616.50
7.3.240.0090.01216.49
7.3.230.0100.00716.39
7.3.210.0060.01216.37
7.3.200.0100.00719.39
7.3.190.0080.00816.38
7.3.180.0180.00016.45
7.3.170.0060.01016.48
7.3.160.0160.00616.33
7.3.120.0070.01115.11
7.3.110.0040.01114.94
7.3.100.0100.00314.85
7.3.90.0060.00914.96
7.3.80.0060.01314.88
7.3.70.0070.00314.88
7.3.60.0080.00814.72
7.3.50.0000.01114.80
7.3.40.0150.00014.70
7.3.30.0080.00314.63
7.3.20.0060.00316.70
7.3.10.0030.00616.56
7.3.00.0060.00916.53
7.2.330.0100.01316.87
7.2.320.0160.00816.72
7.2.310.0060.01016.79
7.2.300.0070.01116.73
7.2.290.0070.01016.61
7.2.250.0080.01115.22
7.2.240.0100.01015.24
7.2.230.0060.00615.23
7.2.220.0120.00014.76
7.2.210.0000.01514.87
7.2.200.0160.00015.12
7.2.190.0150.00015.05
7.2.180.0070.01015.18
7.2.170.0100.00315.08
7.2.60.0060.00617.00
7.2.00.0000.01419.46
7.1.330.0040.00415.65
7.1.320.0030.00715.87
7.1.310.0030.01015.84
7.1.300.0040.00815.71
7.1.290.0100.00015.80
7.1.280.0100.00316.00
7.1.270.0070.00315.71
7.1.260.0030.01015.47
7.1.200.0030.00515.69
7.1.100.0040.00818.05
7.1.70.0000.00717.07
7.1.60.0170.00719.40
7.1.50.0130.00716.89
7.1.00.0070.07722.36
7.0.200.0730.01314.75
7.0.140.0000.07721.97
7.0.60.0070.06319.88
7.0.50.0100.08317.88
7.0.40.0030.04320.30
7.0.30.0530.04320.16
7.0.20.0270.08320.10
7.0.10.0330.07320.30
7.0.00.0100.07320.08
5.6.280.0030.07021.10
5.6.210.0100.06320.57
5.6.200.0070.05718.18
5.6.190.0070.08320.50
5.6.180.0070.05020.39
5.6.170.0230.04020.47
5.6.160.0130.07020.61
5.6.150.0070.07718.16
5.6.140.0070.08018.15
5.6.130.0170.07318.14
5.6.120.0030.04321.00
5.6.110.0030.04020.98
5.6.100.0100.08320.98
5.6.90.0130.07721.04
5.6.80.0000.08320.39
5.6.70.0330.06720.53
5.5.350.0270.07020.39
5.5.340.0070.05017.94
5.5.330.0130.08020.25
5.5.320.0200.05720.58
5.5.310.0230.06320.35
5.5.300.0100.05718.03
5.5.290.0000.05717.95
5.5.280.0030.04320.77
5.5.270.0130.07720.77
5.5.260.0070.03720.82
5.5.250.0100.07320.69
5.5.240.0070.06720.30
5.4.450.3830.04019.21
5.4.440.3930.03719.40
5.4.430.3600.04019.38
5.4.420.3030.04719.45
5.4.410.3000.03019.28
5.4.400.3530.03719.20
5.4.390.3330.03718.88
5.4.380.3800.03718.89
5.4.370.3930.04018.88
5.4.360.3900.03019.15
5.4.350.3570.03719.19
5.4.340.3530.04019.07
5.4.320.4000.03719.09
5.4.310.3800.03719.16
5.4.300.4100.04319.07
5.4.290.3870.04019.16
5.4.280.3870.04718.99
5.4.270.3530.04018.94
5.4.260.3470.04719.13
5.4.250.3870.03719.14
5.4.240.3800.03719.13
5.4.230.3630.03719.15
5.4.220.3970.04319.15
5.4.210.3700.04319.21
5.4.200.3930.04019.10
5.4.190.4600.04019.07
5.4.180.4570.04019.05
5.4.170.3970.04019.09
5.4.160.4070.02319.18
5.4.150.3530.04019.13
5.4.140.3630.03016.38
5.4.130.3900.03016.55
5.4.120.3870.03716.37
5.4.110.3800.03716.64
5.4.100.3870.03316.61
5.4.90.2070.03716.59
5.4.80.0030.06716.62
5.4.70.3900.03016.38
5.4.60.3630.03016.54
5.4.50.3570.03716.24
5.4.40.3770.04316.51
5.4.30.3930.03016.42
5.4.20.4400.04016.34
5.4.10.4370.03316.47
5.4.00.4670.03015.73
5.3.290.3900.03314.88
5.3.280.3900.03714.50
5.3.270.3700.03714.57
5.3.260.3900.04014.66
5.3.250.3530.03714.62
5.3.240.3930.03714.62
5.3.230.3600.03714.71
5.3.220.4170.04014.47
5.3.210.3830.04014.51
5.3.200.3800.03014.54
5.3.190.0030.06314.48
5.3.180.0030.03714.68
5.3.170.3730.03714.45
5.3.160.3870.03314.48
5.3.150.3800.03314.57
5.3.140.4130.04014.61
5.3.130.3330.03714.55
5.3.120.4870.04014.52
5.3.110.4130.04014.52
5.3.100.4470.03713.95
5.3.90.4500.04314.03
5.3.80.3500.03313.93
5.3.70.3870.03314.18
5.3.60.0930.03313.92
5.3.50.0070.07713.85
5.3.40.3270.03713.86
5.3.30.3800.04013.81
5.3.20.3800.03713.77
5.3.10.3800.04013.63
5.3.00.3730.03313.62
5.2.170.0030.06711.45
5.2.160.0070.03011.45
5.2.150.3500.03311.45
5.2.140.3000.02711.45
5.2.130.2770.03711.45
5.2.120.3330.02311.45
5.2.110.3300.02711.45
5.2.100.3100.03311.45
5.2.90.3100.02711.45
5.2.80.3330.02311.45
5.2.70.2930.03011.45
5.2.60.2100.02711.45
5.2.50.2930.02711.45
5.2.40.2400.03011.45
5.2.30.2230.04011.45
5.2.20.3200.03011.45
5.2.10.2430.02711.45
5.2.00.2670.02011.45
5.1.60.2030.02011.45
5.1.50.1830.02311.45
5.1.40.2330.03011.45
5.1.30.2500.02311.45
5.1.20.2100.03011.45
5.1.10.2370.02711.45
5.1.00.2400.02711.45
5.0.50.1200.02011.45
5.0.40.1370.02311.45
5.0.30.1370.03311.45
5.0.20.1430.02311.45
5.0.10.1470.02311.45
5.0.00.1200.03011.45
4.4.90.1070.01311.45
4.4.80.1230.01011.45
4.4.70.1200.01311.45
4.4.60.1200.01311.45
4.4.50.0630.01711.45
4.4.40.1230.02011.45
4.4.30.1170.01711.45
4.4.20.1200.01711.45
4.4.10.1200.01311.45
4.4.00.1230.02011.45
4.3.110.1630.01711.45
4.3.100.1230.02011.45
4.3.90.1500.01711.45
4.3.80.1330.02711.45
4.3.70.1470.01011.45
4.3.60.1470.01711.45
4.3.50.1430.01711.45
4.3.40.1170.02311.45
4.3.30.0770.02311.45
4.3.20.0600.01711.45
4.3.10.0800.02311.45
4.3.00.0700.02011.45

preferences:
38.84 ms | 401 KiB | 5 Q