3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = array(-3,5,1,3,2,10); function array_rev($array) { $half_count = count($array) / 2; for ($i = 0; $i <= $half_count; $i++) { $holder = $array[$i]; $array[$i] = $array[(count($array) - ($i + 1))]; $array[count($array) - ($i + 1)] = $holder; } return $array; } echo array_rev($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.3.60.0060.01316.50
8.3.50.0150.00522.12
8.3.40.0070.00718.80
8.3.30.0100.00319.09
8.3.20.0000.00720.34
8.3.10.0110.00020.62
8.3.00.0040.00419.51
8.2.180.0150.01516.63
8.2.170.0170.00322.96
8.2.160.0100.00720.48
8.2.150.0070.00024.18
8.2.140.0000.00724.66
8.2.130.0080.00026.16
8.2.120.0030.00621.03
8.2.110.0090.00022.20
8.2.100.0070.00417.97
8.2.90.0000.00819.15
8.2.80.0080.00017.97
8.2.70.0040.00417.63
8.2.60.0050.00318.05
8.2.50.0040.00418.07
8.2.40.0040.00418.19
8.2.30.0050.00519.40
8.2.20.0030.00617.80
8.2.10.0070.00018.01
8.2.00.0030.00517.72
8.1.280.0070.01425.92
8.1.270.0040.00423.70
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0050.00523.92
8.1.230.0070.00319.14
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0120.00017.38
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0050.00318.59
8.1.160.0040.00421.94
8.1.150.0040.00418.85
8.1.140.0040.00417.46
8.1.130.0030.00317.79
8.1.120.0080.00017.52
8.1.110.0040.00417.43
8.1.100.0000.00717.35
8.1.90.0060.00317.36
8.1.80.0070.00017.48
8.1.70.0000.00717.48
8.1.60.0060.00317.65
8.1.50.0030.00717.57
8.1.40.0080.00017.41
8.1.30.0000.00817.55
8.1.20.0000.00717.70
8.1.10.0000.00717.45
8.1.00.0000.00717.57
8.0.300.0040.00418.77
8.0.290.0000.00716.63
8.0.280.0070.00018.33
8.0.270.0030.00317.17
8.0.260.0000.00717.30
8.0.250.0000.00716.93
8.0.240.0040.00417.02
8.0.230.0030.00316.93
8.0.220.0000.00816.96
8.0.210.0030.00516.95
8.0.200.0030.00316.93
8.0.190.0070.00016.95
8.0.180.0030.00316.83
8.0.170.0040.00416.88
8.0.160.0030.00416.95
8.0.150.0000.00816.92
8.0.140.0070.00016.80
8.0.130.0000.00613.39
8.0.120.0050.00216.97
8.0.110.0030.00616.86
8.0.100.0000.00716.92
8.0.90.0050.00316.85
8.0.80.0070.00716.96
8.0.70.0040.00416.96
8.0.60.0000.00816.86
8.0.50.0040.00416.80
8.0.30.0120.00916.98
8.0.20.0060.01217.40
8.0.10.0050.00216.99
8.0.00.0090.01016.69
7.4.330.0060.00015.02
7.4.320.0050.00216.38
7.4.300.0000.00616.62
7.4.290.0000.00716.46
7.4.280.0070.00016.49
7.4.270.0070.00016.52
7.4.260.0040.00416.37
7.4.250.0040.00416.62
7.4.240.0020.00516.50
7.4.230.0000.00716.59
7.4.220.0090.01416.43
7.4.210.0090.00616.72
7.4.200.0080.00016.51
7.4.160.0110.00716.50
7.4.150.0150.00917.40
7.4.140.0110.00717.86
7.4.130.0110.01116.53
7.4.120.0090.00916.48
7.4.110.0190.00316.39
7.4.100.0130.00616.52
7.4.90.0060.01216.73
7.4.80.0100.00719.39
7.4.70.0060.01016.56
7.4.60.0110.00616.54
7.4.50.0000.00916.37
7.4.40.0070.01016.61
7.4.30.0120.00316.52
7.4.00.0080.00715.10
7.3.330.0060.00013.36
7.3.320.0000.00513.29
7.3.310.0040.00416.48
7.3.300.0030.00316.43
7.3.290.0070.01116.41
7.3.280.0080.00916.42
7.3.270.0030.01317.40
7.3.260.0070.01116.40
7.3.250.0130.00616.58
7.3.240.0140.00316.64
7.3.230.0040.01216.48
7.3.210.0100.00716.61
7.3.200.0140.00319.39
7.3.190.0030.01416.47
7.3.180.0100.00516.45
7.3.170.0140.00716.58
7.3.160.0150.00016.44
7.3.120.0050.01014.91
7.3.110.0030.01414.72
7.3.100.0090.00715.01
7.3.90.0080.00614.80
7.3.80.0060.00814.92
7.3.70.0030.00914.77
7.3.60.0050.00914.69
7.3.50.0090.00714.79
7.3.40.0070.00614.86
7.3.30.0050.00514.77
7.3.20.0090.00516.69
7.3.10.0070.00716.75
7.3.00.0070.00516.77
7.2.330.0070.01416.77
7.2.320.0070.01016.50
7.2.310.0140.00316.67
7.2.300.0060.00916.77
7.2.290.0140.00316.66
7.2.250.0030.01615.07
7.2.240.0060.00914.92
7.2.230.0060.01015.20
7.2.220.0080.00814.91
7.2.210.0000.01414.95
7.2.200.0090.00515.17
7.2.190.0090.00715.02
7.2.180.0110.00515.26
7.2.170.0060.00615.17
7.2.160.0030.00915.11
7.2.150.0080.00417.06
7.2.140.0120.00316.98
7.2.130.0100.00317.06
7.2.120.0110.00716.99
7.2.110.0070.00716.90
7.2.100.0180.00016.91
7.2.90.0070.01117.02
7.2.80.0030.01016.97
7.2.70.0000.01616.78
7.2.60.0100.00717.05
7.2.50.0100.00316.96
7.2.40.0070.01016.73
7.2.30.0040.01516.74
7.2.20.0120.00016.77
7.2.10.0070.01016.70
7.2.00.0070.00716.80
7.1.330.0090.00615.76
7.1.320.0030.00715.93
7.1.310.0080.00615.86
7.1.300.0030.00815.83
7.1.290.0060.00815.91
7.1.280.0070.00415.81
7.1.270.0070.00515.83
7.1.260.0060.00515.91
7.1.250.0070.01015.88
7.1.70.0030.00717.29
7.1.60.0030.01419.61
7.1.50.0070.01617.14
7.1.00.0030.07722.49
7.0.200.0050.00516.88
7.0.140.0130.06322.09
7.0.60.0030.08020.10
7.0.50.0100.03717.88
7.0.40.0100.07320.27
7.0.30.0400.05020.23
7.0.20.0330.08020.11
7.0.10.0330.04320.16
7.0.00.0070.04320.09
5.6.280.0030.07321.04
5.6.210.0070.03720.50
5.6.200.0030.04018.15
5.6.190.0130.06720.60
5.6.180.0200.04020.77
5.6.170.0300.04720.71
5.6.160.0100.08020.55
5.6.150.0070.07718.21
5.6.140.0030.04718.15
5.6.130.0070.03718.17
5.6.120.0070.09020.90
5.6.110.0070.08321.12
5.6.100.0030.07321.12
5.6.90.0100.07721.01
5.6.80.0030.08720.38
5.6.70.4400.04320.48
5.5.350.0070.08020.37
5.5.340.0000.08017.96
5.5.330.0030.07720.43
5.5.320.0370.08020.20
5.5.310.0070.05020.34
5.5.300.0030.07718.02
5.5.290.0070.04017.99
5.5.280.0100.08020.82
5.5.270.0170.07720.79
5.5.260.0070.09020.89
5.5.250.0070.06320.71
5.5.240.0330.07020.16
5.4.450.0470.04019.20
5.4.440.1030.03019.27
5.4.430.0530.05319.39
5.4.420.0730.05019.45
5.4.410.0100.05319.54
5.4.400.0570.04718.89
5.4.390.0630.06019.31
5.4.380.0230.06318.71
5.4.370.0270.06018.44
5.4.360.0430.04718.48
5.4.350.0270.07018.61
5.4.340.0130.06318.71
5.4.320.0050.04112.51
5.4.310.0090.03812.50
5.4.300.0070.03612.50
5.4.290.0070.04112.50
5.4.280.0090.03712.40
5.4.270.0100.03412.40
5.4.260.0080.03712.40
5.4.250.0070.03612.40
5.4.240.0080.04612.40
5.4.230.0010.04312.39
5.4.220.0080.03512.39
5.4.210.0050.03712.39
5.4.200.0050.03912.39
5.4.190.0100.04312.39
5.4.180.0110.03712.39
5.4.170.0080.04112.40
5.4.160.0070.04312.39
5.4.150.0060.04512.38
5.4.140.0050.06212.07
5.4.130.0100.03212.05
5.4.120.0060.03512.02
5.4.110.0050.03612.01
5.4.100.0060.03612.01
5.4.90.0080.03812.01
5.4.80.0050.03812.01
5.4.70.0070.03312.01
5.4.60.0070.03312.01
5.4.50.0070.03512.01
5.4.40.0020.04212.00
5.4.30.0080.04211.99
5.4.20.0080.03311.99
5.4.10.0050.03512.00
5.4.00.0060.03511.48
5.3.290.0090.03712.80
5.3.280.0100.03412.71
5.3.270.0050.04012.72
5.3.260.0110.05312.72
5.3.250.0110.04212.72
5.3.240.0070.04812.72
5.3.230.0070.03812.71
5.3.220.0060.04112.68
5.3.210.0130.04112.68
5.3.200.0110.04312.68
5.3.190.0090.04312.68
5.3.180.0080.03712.67
5.3.170.0060.04912.67
5.3.160.0080.04312.67
5.3.150.0070.03812.67
5.3.140.0080.03512.66
5.3.130.0060.03912.66
5.3.120.0080.03712.66
5.3.110.0070.03812.66
5.3.100.0070.04012.12
5.3.90.0090.04012.10
5.3.80.0090.03412.09
5.3.70.0070.03512.09
5.3.60.0060.04012.08
5.3.50.0080.03312.03
5.3.40.0080.03512.03
5.3.30.0050.03611.98
5.3.20.0070.03511.77
5.3.10.0140.03711.73
5.3.00.0030.03911.72
5.2.170.0060.0289.22
5.2.160.0050.0299.22
5.2.150.0060.0299.22
5.2.140.0060.0299.22
5.2.130.0050.0439.18
5.2.120.0070.0359.18
5.2.110.0040.0299.18
5.2.100.0060.0269.18
5.2.90.0020.0319.17
5.2.80.0070.0279.17
5.2.70.0050.0299.17
5.2.60.0060.0309.13
5.2.50.0070.0309.09
5.2.40.0050.0289.07
5.2.30.0050.0289.05
5.2.20.0080.0449.04
5.2.10.0050.0288.94
5.2.00.0040.0308.80
5.1.60.0040.0278.09
5.1.50.0050.0238.08
5.1.40.0050.0238.06
5.1.30.0030.0288.41
5.1.20.0060.0248.43
5.1.10.0020.0288.16
5.1.00.0020.0278.17
5.0.50.0040.0206.64
5.0.40.0040.0196.50
5.0.30.0010.0346.32
5.0.20.0020.0216.28
5.0.10.0040.0196.25
5.0.00.0020.0336.25
4.4.90.0030.0154.78
4.4.80.0020.0164.75
4.4.70.0010.0174.75
4.4.60.0030.0154.75
4.4.50.0030.0154.77
4.4.40.0010.0264.71
4.4.30.0050.0134.76
4.4.20.0020.0164.85
4.4.10.0000.0184.85
4.4.00.0030.0254.76
4.3.110.0050.0134.67
4.3.100.0030.0144.66
4.3.90.0040.0124.63
4.3.80.0040.0224.58
4.3.70.0040.0134.63
4.3.60.0030.0144.63
4.3.50.0020.0164.63
4.3.40.0020.0244.54
4.3.30.0030.0213.30
4.3.20.0010.0163.28
4.3.10.0030.0173.24
4.3.00.0000.01714.59

preferences:
43.69 ms | 400 KiB | 5 Q