3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getPairs(array $data) { if(!($end=count($data))) { return null; } shuffle($data); $result = [[$data[0], $data[$end-1]]]; for($i=0; $i<$end-1; $i++) { $result[] = [$data[$i], $data[$i+1]]; } return $result; } $data = ['First', 'Second', 'Third', 'Fourth', 'Fifth', 'Sixth']; var_dump(getPairs([]));

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.0040.01514.75
7.4.00.0060.01314.99
7.3.130.0040.01514.90
7.3.120.0080.01014.88
7.3.110.0070.01014.79
7.3.100.0090.00414.91
7.3.90.0070.00714.72
7.3.80.0020.00914.79
7.3.70.0080.00614.81
7.3.60.0040.00914.74
7.3.50.0080.00614.81
7.3.40.0040.00914.72
7.3.30.0050.01014.64
7.3.20.0090.00516.57
7.3.10.0060.00816.66
7.3.00.0040.00916.67
7.2.260.0040.01315.11
7.2.250.0070.00914.95
7.2.240.0030.01215.05
7.2.230.0070.00815.03
7.2.220.0060.01214.79
7.2.210.0090.00514.93
7.2.200.0060.00614.99
7.2.190.0020.01214.92
7.2.180.0060.00814.91
7.2.170.0060.00814.82
7.2.160.0050.01014.91
7.2.150.0050.00916.75
7.2.140.0030.01116.77
7.2.130.0050.00816.92
7.2.120.0060.01016.77
7.2.110.0060.00716.83
7.2.100.0070.00616.76
7.2.90.0070.00816.81
7.2.80.0060.00916.76
7.2.70.0070.00516.93
7.2.60.0040.00916.78
7.2.50.0050.01016.77
7.2.40.0050.00916.86
7.2.30.0080.00716.80
7.2.20.0050.01116.92
7.2.10.0070.00716.85
7.2.00.0040.01016.85
7.1.330.0040.01015.81
7.1.320.0030.01015.71
7.1.310.0060.00915.86
7.1.300.0020.00915.62
7.1.290.0060.00615.63
7.1.280.0040.00815.68
7.1.270.0060.00815.75
7.1.260.0050.00615.70
7.1.250.0050.00715.69
7.1.240.0080.00515.77
7.1.230.0060.00815.72
7.1.220.0050.01015.65
7.1.210.0060.00715.69
7.1.200.0050.00715.65
7.1.190.0030.00815.63
7.1.180.0080.00815.68
7.1.170.0050.00815.67
7.1.160.0030.00915.72
7.1.150.0080.00515.66
7.1.140.0060.00515.71
7.1.130.0050.01015.63
7.1.120.0080.00615.79
7.1.110.0090.00415.72
7.1.100.0040.00815.83
7.1.90.0060.00715.82
7.1.80.0050.00715.73
7.1.70.0070.00315.92
7.1.60.0070.00716.53
7.1.50.0050.00915.88
7.1.40.0040.00715.60
7.1.30.0050.00915.53
7.1.20.0070.00515.77
7.1.10.0050.00715.71
7.1.00.0060.01916.96
7.0.330.0090.00415.32
7.0.320.0060.00615.35
7.0.310.0060.00515.36
7.0.300.0060.00815.33
7.0.290.0020.00815.31
7.0.280.0060.01015.42
7.0.270.0060.00815.24
7.0.260.0080.00615.48
7.0.250.0060.00615.25
7.0.240.0090.00415.43
7.0.230.0050.00415.42
7.0.220.0050.00615.33
7.0.210.0040.00815.39
7.0.200.0030.01015.57
7.0.190.0040.00815.27
7.0.180.0060.00415.29
7.0.170.0050.00615.38
7.0.160.0050.00615.41
7.0.150.0070.00515.30
7.0.140.0050.02016.75
7.0.130.0060.00815.47
7.0.120.0060.00715.39
7.0.110.0050.00815.29
7.0.100.0070.00415.44
7.0.90.0050.00615.40
7.0.80.0120.01616.36
7.0.70.0160.02016.21
7.0.60.0110.02216.23
7.0.50.0130.02116.40
7.0.40.0050.01514.79
7.0.30.0030.02114.66
7.0.20.0050.02214.73
7.0.10.0100.01814.81
7.0.00.0050.02414.82
5.6.400.0070.00614.34
5.6.390.0060.00614.34
5.6.380.0030.01114.33
5.6.370.0030.01114.34
5.6.360.0070.00614.34
5.6.350.0080.00414.40
5.6.340.0060.00514.08
5.6.330.0050.00514.32
5.6.320.0050.00814.31
5.6.310.0030.01014.25
5.6.300.0060.00714.31
5.6.290.0030.00814.28
5.6.280.0040.02215.51
5.6.270.0030.00914.25
5.6.260.0050.00514.37
5.6.250.0050.00914.02
5.6.240.0060.00614.15
5.6.230.0060.02215.46
5.6.220.0060.02315.54
5.6.210.0040.01715.52
5.6.200.0060.02015.60
5.6.190.0080.02215.65
5.6.180.0060.02215.73
5.6.170.0090.01215.67
5.6.160.0060.01615.63
5.6.150.0090.01715.63
5.6.140.0080.02215.58
5.6.130.0050.01815.64
5.6.120.0030.01715.65
5.6.110.0050.01615.62
5.6.100.0070.02115.61
5.6.90.0060.02315.63
5.6.80.0050.01715.41
5.6.70.0050.02515.42
5.6.60.0050.02215.39
5.6.50.0040.02415.31
5.6.40.0070.01815.50
5.6.30.0080.02215.32
5.6.20.0070.01615.37
5.6.10.0050.02415.42
5.6.00.0090.01815.42
5.5.380.0070.00513.47
5.5.370.0040.02514.76
5.5.360.0050.01614.66
5.5.350.0050.02114.77
5.5.340.0080.01814.91
5.5.330.0030.01714.88
5.5.320.0040.02314.94
5.5.310.0050.01414.98
5.5.300.0040.02214.87
5.5.290.0050.01614.83
5.5.280.0050.02314.72
5.5.270.0030.01714.93
5.5.260.0060.01614.82
5.5.250.0050.01914.67
5.5.240.0040.02314.73
5.5.230.0060.01714.61
5.5.220.0050.01814.66
5.5.210.0090.01914.64
5.5.200.0090.01814.66
5.5.190.0060.01814.73
5.5.180.0070.01814.67
5.5.170.0070.00513.40
5.5.160.0100.01914.69
5.5.150.0050.01514.78
5.5.140.0100.01914.71
5.5.130.0070.02014.55
5.5.120.0050.01514.63
5.5.110.0040.01714.65
5.5.100.0050.02114.51
5.5.90.0050.02014.70
5.5.80.0070.02114.51
5.5.70.0050.01614.65
5.5.60.0060.01714.59
5.5.50.0060.02114.72
5.5.40.0050.01714.75
5.5.30.0090.01814.72
5.5.20.0040.02514.68
5.5.10.0050.01514.64
5.5.00.0060.02014.49
5.4.450.0040.01812.96
5.4.440.0050.02112.98
5.4.430.0030.01412.93
5.4.420.0040.02212.98
5.4.410.0050.01513.02
5.4.400.0050.01512.91
5.4.390.0030.01613.03
5.4.380.0060.01712.96
5.4.370.0040.02112.93
5.4.360.0030.01612.98
5.4.350.0050.01512.93
5.4.340.0050.02012.89
5.4.330.0040.00711.40
5.4.320.0040.01712.91
5.4.310.0030.02013.00
5.4.300.0040.02112.88
5.4.290.0030.02112.85
5.4.280.0060.01712.91
5.4.270.0050.01812.99
5.4.260.0020.02012.96
5.4.250.0060.01412.91
5.4.240.0030.01813.01
5.4.230.0050.01512.95
5.4.220.0050.02112.93
5.4.210.0060.01712.92
5.4.200.0060.01913.01
5.4.190.0040.02012.98
5.4.180.0050.01412.97
5.4.170.0070.01813.03
5.4.160.0040.02012.96
5.4.150.0060.01713.00
5.4.140.0030.01812.40
5.4.130.0050.02012.49
5.4.120.0030.01912.43
5.4.110.0040.01812.45
5.4.100.0050.02012.44
5.4.90.0040.02012.43
5.4.80.0050.01912.38
5.4.70.0060.01812.46
5.4.60.0050.01212.44
5.4.50.0020.01512.43
5.4.40.0050.01112.51
5.4.30.0020.01812.52
5.4.20.0010.01312.37
5.4.10.0030.01412.50
5.4.00.0050.00912.24
5.3.290.0060.01811.86
5.3.280.0070.01711.77
5.3.270.0040.02211.83
5.3.260.0050.01911.83
5.3.250.0050.01911.78
5.3.240.0060.01611.79
5.3.230.0030.01911.81
5.3.220.0030.02111.75
5.3.210.0040.02011.78
5.3.200.0050.01911.78
5.3.190.0030.02211.80
5.3.180.0040.01511.77
5.3.170.0030.01911.82
5.3.160.0040.01111.89
5.3.150.0060.01611.83
5.3.140.0040.01111.76
5.3.130.0020.01211.84
5.3.120.0020.01311.86
5.3.110.0040.01011.75
5.3.100.0060.01511.70
5.3.90.0030.01211.65
5.3.80.0040.01011.70
5.3.70.0030.01311.63
5.3.60.0030.01311.68
5.3.50.0050.01911.63
5.3.40.0050.01111.57
5.3.30.0050.01011.59
5.3.20.0060.01811.61
5.3.10.0040.01111.53
5.3.00.0030.01111.50
5.2.170.0050.02010.39
5.2.160.0020.01610.39
5.2.150.0030.01810.52
5.2.140.0000.01810.50
5.2.130.0030.03310.50
5.2.120.0030.02810.52
5.2.110.0070.02810.50
5.2.100.0010.02010.51
5.2.90.0030.01610.36
5.2.80.0050.03310.46
5.2.70.0050.02010.41
5.2.60.0030.02210.44
5.2.50.0030.02210.56
5.2.40.0020.02010.48
5.2.30.0020.02210.45
5.2.20.0030.01510.26
5.2.10.0020.01410.37
5.2.00.0020.02310.39
5.1.60.0080.02310.02
5.1.50.0040.01210.04
5.1.40.0020.01510.10
5.1.30.0000.01810.03
5.1.20.0010.0309.96
5.1.10.0020.01710.05
5.1.00.0030.0139.98
5.0.50.0020.0129.94
5.0.40.0040.0109.94
5.0.30.0010.0189.94
5.0.20.0090.0079.94
5.0.10.0010.0119.94
5.0.00.0020.0159.94
4.4.90.0030.0179.94
4.4.80.0000.0179.94
4.4.70.0020.0089.94
4.4.60.0020.0099.94
4.4.50.0040.0079.94
4.4.40.0000.0269.94
4.4.30.0020.0109.94
4.4.20.0030.0099.94
4.4.10.0020.0159.94
4.4.00.0000.0239.94
4.3.110.0010.0089.94
4.3.100.0000.0139.94
4.3.90.0010.0089.94
4.3.80.0030.0229.94
4.3.70.0030.0109.94
4.3.60.0050.0079.94
4.3.50.0000.0129.94
4.3.40.0030.0259.94
4.3.30.0020.0089.94
4.3.20.0020.0109.94
4.3.10.0020.0139.94
4.3.00.0000.0179.94

preferences:
26.72 ms | 401 KiB | 5 Q