3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = ['First', 'Second', 'Third', 'Fourth', 'Fifth', 'Sixth']; $temp = $data; $result = []; foreach($data as $i=>$item) { $item = array_shift($temp); $pair = array_rand($temp); $result[] = [$item, $temp[$pair]]; unset($temp[$pair]); } var_dump($result);

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)
7.4.10.0060.01215.13
7.4.00.0070.01014.71
7.3.130.0030.01314.88
7.3.120.0040.01415.00
7.3.110.0000.01414.86
7.3.100.0070.01014.82
7.3.90.0060.01014.67
7.3.80.0090.00614.91
7.3.70.0000.01814.83
7.3.60.0000.01514.79
7.3.50.0070.00714.68
7.3.40.0030.00514.85
7.3.30.0030.01014.74
7.3.20.0060.00316.73
7.3.10.0030.01316.86
7.3.00.0060.01116.89
7.2.260.0120.00615.25
7.2.250.0130.00314.87
7.2.240.0030.01015.04
7.2.230.0030.01315.19
7.2.220.0100.01014.86
7.2.210.0030.01015.19
7.2.200.0070.01015.12
7.2.190.0120.00015.20
7.2.180.0060.00615.12
7.2.170.0110.00415.13
7.2.160.0060.00915.12
7.2.150.0000.01517.10
7.2.140.0060.00917.02
7.2.130.0070.00716.92
7.2.120.0060.00917.00
7.2.110.0100.00317.08
7.2.100.0070.00717.03
7.2.90.0040.01116.68
7.2.80.0040.00816.82
7.2.70.0060.00617.05
7.2.60.0070.00717.09
7.2.50.0060.01016.84
7.2.40.0060.01016.81
7.2.30.0100.00316.95
7.2.20.0000.00916.93
7.2.10.0040.01116.96
7.2.00.0050.00917.96
7.1.330.0070.01015.78
7.1.320.0100.00315.71
7.1.310.0040.00415.89
7.1.300.0080.00815.66
7.1.290.0060.00615.78
7.1.280.0100.00315.55
7.1.270.0110.00415.85
7.1.260.0070.01015.63
7.1.250.0000.01516.02
7.1.240.0030.00916.01
7.1.230.0030.00915.74
7.1.220.0040.00815.87
7.1.210.0040.01115.64
7.1.200.0070.00715.64
7.1.190.0080.00415.80
7.1.180.0030.01015.93
7.1.170.0090.00616.02
7.1.160.0090.00615.81
7.1.150.0040.01115.98
7.1.140.0070.01015.94
7.1.130.0140.00015.97
7.1.120.0040.01115.79
7.1.110.0100.00315.84
7.1.100.0090.00316.02
7.1.90.0070.00715.74
7.1.80.0070.00715.85
7.1.70.0090.00316.47
7.1.60.0030.01016.57
7.1.50.0020.01216.35
7.1.40.0030.00616.26
7.1.30.0020.01216.26
7.1.20.0080.00316.31
7.1.10.0030.00716.35
7.1.00.0080.00516.27
7.0.330.0030.01015.25
7.0.320.0030.01015.29
7.0.310.0100.00315.24
7.0.300.0070.00715.58
7.0.290.0060.00615.45
7.0.280.0040.01115.46
7.0.270.0060.00915.39
7.0.260.0070.00715.13
7.0.250.0000.00815.66
7.0.240.0000.01015.47
7.0.230.0000.01415.58
7.0.220.0100.00315.38
7.0.210.0030.01015.38
7.0.200.0020.00916.23
7.0.190.0000.01015.96
7.0.180.0040.00716.03
7.0.170.0030.01216.00
7.0.160.0000.00816.13
7.0.150.0050.00616.04
7.0.140.0030.00916.10
7.0.130.0020.00815.95
7.0.120.0030.00916.07
7.0.110.0050.00616.02
7.0.100.0050.00815.94
7.0.90.0030.00616.03
7.0.80.0090.00315.93
7.0.70.0020.00815.94
7.0.60.0030.00716.05
7.0.50.0020.01116.10
7.0.40.0020.00815.00
7.0.30.0050.00714.98
7.0.20.0060.00715.04
7.0.10.0060.00715.09
7.0.00.0060.00715.03
5.6.400.0120.00314.52
5.6.390.0030.00914.65
5.6.380.0080.00414.66
5.6.370.0100.00314.32
5.6.360.0110.00014.47
5.6.350.0030.00614.38
5.6.340.0030.00914.37
5.6.330.0060.00314.73
5.6.320.0030.01014.22
5.6.310.0030.00714.66
5.6.300.0150.03017.59
5.6.290.0050.02817.53
5.6.280.0120.02017.78
5.6.270.0200.01817.65
5.6.260.0040.02917.89
5.6.250.0020.03117.61
5.6.240.0050.02817.83
5.6.230.0030.02717.64
5.6.220.0110.03017.65
5.6.210.0020.03017.44
5.6.200.0030.03117.78
5.6.190.0080.02717.58
5.6.180.0020.02817.66
5.6.170.0030.02717.67
5.6.160.0100.02417.59
5.6.150.0110.02117.72
5.6.140.0070.03117.59
5.6.130.0030.02817.65
5.6.120.0050.02517.53
5.6.110.0070.02317.72
5.6.100.0060.02217.52
5.6.90.0060.02317.62
5.6.80.0020.02817.32
5.6.70.0080.02317.27
5.6.60.0100.02117.23
5.6.50.0030.02517.27
5.6.40.0070.03817.47
5.6.30.0030.02717.41
5.6.20.0110.04217.19
5.6.10.0050.02717.38
5.6.00.0070.02217.38
5.5.380.0020.02715.81
5.5.370.0030.02715.84
5.5.360.0050.02615.74
5.5.350.0040.02615.93
5.5.340.0050.02416.13
5.5.330.0030.02715.96
5.5.320.0080.02016.19
5.5.310.0060.02716.29
5.5.300.0070.02816.27
5.5.290.0030.02915.87
5.5.280.0020.02716.37
5.5.270.0060.02816.29
5.5.260.0020.03116.24
5.5.250.0030.02716.02
5.5.240.0020.02515.77
5.5.230.0020.02915.91
5.5.220.0060.02315.80
5.5.210.0020.03915.85
5.5.200.0050.02315.88
5.5.190.0030.02315.84
5.5.180.0080.02315.65
5.5.170.0080.00614.44
5.5.160.0030.02515.75
5.5.150.0050.02315.73
5.5.140.0060.02015.77
5.5.130.0050.02215.89
5.5.120.0040.04315.78
5.5.110.0070.03715.90
5.5.100.0020.02415.85
5.5.90.0050.02215.56
5.5.80.0020.03015.94
5.5.70.0050.02315.70
5.5.60.0060.02315.73
5.5.50.0020.03315.64
5.5.40.0050.02315.84
5.5.30.0020.02215.75
5.5.20.0040.02515.51
5.5.10.0050.02115.76
5.5.00.0020.03615.68
5.4.450.0060.02315.23
5.4.440.0050.02915.39
5.4.430.0000.02715.13
5.4.420.0020.02615.22
5.4.410.0070.02115.07
5.4.400.0030.02114.82
5.4.390.0070.02415.17
5.4.380.0050.02014.83
5.4.370.0050.02315.11
5.4.360.0050.02414.88
5.4.350.0050.02314.92
5.4.340.0050.02715.11
5.4.330.0000.00611.04
5.4.320.0050.02414.96
5.4.310.0060.01915.00
5.4.300.0080.01914.92
5.4.290.0020.02514.95
5.4.280.0020.02415.04
5.4.270.0100.01715.05
5.4.260.0050.02314.83
5.4.250.0020.02715.09
5.4.240.0050.03214.98
5.4.230.0050.02215.20
5.4.220.0040.02515.01
5.4.210.0000.02615.17
5.4.200.0030.02115.06
5.4.190.0050.02015.01
5.4.180.0020.02715.08
5.4.170.0060.02014.94
5.4.160.0050.02115.15
5.4.150.0050.02014.88
5.4.140.0050.02713.93
5.4.130.0050.02213.83
5.4.120.0020.02113.76
5.4.110.0050.01913.85
5.4.100.0020.02413.78
5.4.90.0050.01713.81
5.4.80.0060.01713.98
5.4.70.0050.02213.92
5.4.60.0030.02313.84
5.4.50.0030.02513.81
5.4.40.0150.02113.91
5.4.30.0080.01813.72
5.4.20.0070.02013.71
5.4.10.0060.02213.72
5.4.00.0020.02013.79
5.3.290.0070.04016.61
5.3.280.0040.03616.61
5.3.270.0030.03716.61
5.3.260.0030.04016.61
5.3.250.0000.04916.61
5.3.240.0130.02616.61
5.3.230.0070.03616.61
5.3.220.0000.04016.61
5.3.210.0000.04416.61
5.3.200.0090.03016.61
5.3.190.0030.03516.61
5.3.180.0060.03716.61
5.3.170.0060.03616.61
5.3.160.0060.03516.61
5.3.150.0090.02916.61
5.3.140.0000.04716.61
5.3.130.0070.04316.61
5.3.120.0040.04616.61
5.3.110.0100.03216.61
5.3.100.0040.04316.61
5.3.90.0060.03116.61
5.3.80.0070.03416.61
5.3.70.0000.03916.61
5.3.60.0030.03816.61
5.3.50.0030.03616.61
5.3.40.0210.02716.61
5.3.30.0100.03016.61
5.3.20.0030.05316.61
5.3.10.0100.03816.61
5.3.00.0100.03016.61
5.2.170.0030.02816.61
5.2.160.0000.03116.61
5.2.150.0000.03916.61
5.2.140.0000.03916.61
5.2.130.0090.03016.61
5.2.120.0030.06316.61
5.2.110.0000.03616.61
5.2.100.0030.03316.61
5.2.90.0000.03016.61
5.2.80.0000.03316.61
5.2.70.0070.02816.61
5.2.60.0000.03516.61
5.2.50.0000.03416.61
5.2.40.0030.03116.61
5.2.30.0060.02916.61
5.2.20.0030.03316.61
5.2.10.0030.03116.61
5.2.00.0030.03216.61
5.1.60.0000.02916.61
5.1.50.0000.02616.61
5.1.40.0000.02816.61
5.1.30.0030.02716.61
5.1.20.0000.03116.61
5.1.10.0040.02216.61
5.1.00.0030.02416.61
5.0.50.0000.02916.61
5.0.40.0000.02216.61
5.0.30.0000.04216.61
5.0.20.0000.02316.61
5.0.10.0030.02116.61
5.0.00.0030.03016.61
4.4.90.0000.01816.61
4.4.80.0030.01716.61
4.4.70.0000.01916.61
4.4.60.0000.01816.61
4.4.50.0000.01716.61
4.4.40.0030.02316.61
4.4.30.0100.01716.61
4.4.20.0040.01416.61
4.4.10.0040.01316.61
4.4.00.0000.02716.61
4.3.110.0040.01416.61
4.3.100.0000.01616.61
4.3.90.0060.01216.61
4.3.80.0000.02616.61
4.3.70.0000.02116.61
4.3.60.0080.01416.61
4.3.50.0000.01716.61
4.3.40.0000.02616.61
4.3.30.0030.01616.61
4.3.20.0000.01716.61
4.3.10.0000.01716.61
4.3.00.0000.01716.61

preferences:
37.15 ms | 401 KiB | 5 Q