3v4l.org

run code in 300+ PHP versions simultaneously
<?php $input = array( 0 => 'fruit', 1 => 'apple', 2 => 'vegetable', 3 => 'corn', ); /* remove last item from odd arrays */ if( count( $input ) % 2 != 0 ) { array_pop( $input ); } $output = array(); $inputLength = count( $input ); for( $i = 0; $i < $inputLength; $i = $i + 2 ) { $output[$input[$i]] = $input[$i + 1]; } var_dump( $output );

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.70.0150.00616.48
8.3.60.0070.00716.50
8.3.50.0190.01521.91
8.3.40.0070.00718.66
8.3.30.0030.01019.04
8.3.20.0090.00020.34
8.3.10.0030.00623.70
8.3.00.0080.00019.38
8.2.180.0100.00718.27
8.2.170.0110.00422.96
8.2.160.0030.01020.39
8.2.150.0050.00324.18
8.2.140.0000.00824.66
8.2.130.0110.00726.16
8.2.120.0040.00422.26
8.2.110.0060.00322.21
8.2.100.0060.00617.91
8.2.90.0030.00519.27
8.2.80.0030.00618.05
8.2.70.0030.00717.63
8.2.60.0050.00317.80
8.2.50.0050.00318.07
8.2.40.0050.00318.16
8.2.30.0040.00418.15
8.2.20.0070.00017.71
8.2.10.0000.00718.11
8.2.00.0000.00917.80
8.1.280.0070.00725.92
8.1.270.0050.00322.12
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.91
8.1.230.0110.00019.04
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0050.00317.53
8.1.180.0040.00418.10
8.1.170.0030.00518.64
8.1.160.0040.00422.00
8.1.150.0000.00718.54
8.1.140.0000.00717.50
8.1.130.0000.00717.83
8.1.120.0000.01117.47
8.1.110.0040.00417.49
8.1.100.0040.00417.43
8.1.90.0040.00417.35
8.1.80.0040.00417.42
8.1.70.0000.00717.40
8.1.60.0000.00817.41
8.1.50.0040.00417.55
8.1.40.0030.00517.40
8.1.30.0040.00417.63
8.1.20.0040.00417.67
8.1.10.0040.00417.54
8.1.00.0050.00317.56
8.0.300.0060.00318.77
8.0.290.0000.00817.05
8.0.280.0070.00018.44
8.0.270.0000.00717.23
8.0.260.0070.00016.83
8.0.250.0050.00316.95
8.0.240.0030.00516.97
8.0.230.0040.00416.82
8.0.220.0040.00416.92
8.0.210.0080.00016.77
8.0.200.0000.00616.87
8.0.190.0030.00616.80
8.0.180.0000.00716.91
8.0.170.0040.00416.99
8.0.160.0000.00816.95
8.0.150.0000.00816.87
8.0.140.0040.00416.84
8.0.130.0000.00613.28
8.0.120.0070.00016.75
8.0.110.0000.00816.89
8.0.100.0030.00516.85
8.0.90.0040.00416.75
8.0.80.0000.01516.89
8.0.70.0000.00816.86
8.0.60.0040.00416.96
8.0.50.0000.00816.82
8.0.30.0170.00316.89
8.0.20.0120.00917.40
8.0.10.0000.00716.87
8.0.00.0100.01116.65
7.4.330.0000.00515.07
7.4.320.0070.00016.37
7.4.300.0030.00316.51
7.4.290.0080.00316.64
7.4.280.0040.00416.55
7.4.270.0030.00316.52
7.4.260.0030.00316.45
7.4.250.0040.00416.48
7.4.240.0020.00516.59
7.4.230.0000.00716.48
7.4.220.0090.00916.64
7.4.210.0060.01016.57
7.4.200.0030.00516.32
7.4.190.0000.00716.73
7.4.160.0060.01016.34
7.4.150.0100.00717.40
7.4.140.0080.01217.86
7.4.130.0130.00316.53
7.4.120.0120.00816.55
7.4.110.0090.01016.55
7.4.100.0090.00916.63
7.4.90.0110.00516.62
7.4.80.0120.00619.39
7.4.70.0150.00316.41
7.4.60.0110.00716.54
7.4.50.0040.00416.42
7.4.40.0070.01022.77
7.4.30.0040.01216.73
7.4.00.0130.00014.85
7.3.330.0030.00313.06
7.3.320.0050.00013.19
7.3.310.0000.00716.17
7.3.300.0030.00516.18
7.3.290.0090.01216.33
7.3.280.0130.00916.31
7.3.270.0070.01117.40
7.3.260.0070.03416.43
7.3.250.0130.00716.49
7.3.240.0130.01016.34
7.3.230.0090.00616.41
7.3.210.0140.00316.59
7.3.200.0120.00419.39
7.3.190.0070.01116.32
7.3.180.0140.00316.61
7.3.170.0080.00816.35
7.3.160.0120.00916.63
7.3.120.0040.01415.05
7.3.10.0070.00716.55
7.3.00.0130.00016.66
7.2.330.0060.01216.52
7.2.320.0090.00916.80
7.2.310.0070.01416.74
7.2.300.0110.00616.61
7.2.290.0030.01316.40
7.2.130.0070.00717.05
7.2.120.0130.00016.89
7.2.110.0030.01016.88
7.2.100.0060.00617.02
7.2.90.0110.00716.81
7.2.80.0070.00717.14
7.2.70.0100.00916.98
7.2.60.0040.01117.06
7.2.50.0110.00716.93
7.2.40.0040.01217.10
7.2.30.0110.00316.86
7.2.20.0050.00917.12
7.2.10.0090.00016.97
7.2.00.0030.00918.22
7.1.250.0080.00815.78
7.1.200.0090.00315.67
7.1.100.0040.00418.28
7.1.70.0040.00417.28
7.1.60.0070.01719.33
7.1.50.0080.01217.07
7.1.00.0030.07722.28
7.0.200.0060.00616.93
7.0.140.0000.07022.02
7.0.60.0130.08019.91
7.0.50.0100.08017.91
7.0.40.0170.08020.26
7.0.30.0170.04720.30
7.0.20.0170.08320.13
7.0.10.0100.08320.12
7.0.00.0030.04320.19
5.6.280.0070.07021.00
5.6.210.0100.08020.45
5.6.200.0130.07718.13
5.6.190.0170.07720.61
5.6.180.0200.04720.43
5.6.170.0230.05320.54
5.6.160.0170.07320.52
5.6.150.0000.04018.15
5.6.140.0130.07318.17
5.6.130.0100.07718.08
5.6.120.0000.04721.04
5.6.110.0030.05021.02
5.6.100.0100.04020.96
5.6.90.0130.07720.96
5.6.80.0100.07020.37
5.6.70.0200.08020.27
5.5.350.0030.05020.33
5.5.340.0100.06717.95
5.5.330.0130.07720.40
5.5.320.0470.06320.20
5.5.310.0300.08020.23
5.5.300.0070.08717.98
5.5.290.0100.06718.03
5.5.280.0100.07320.84
5.5.270.0000.05720.67
5.5.260.0070.08720.83
5.5.250.0130.08020.61
5.5.240.0000.03320.07
5.4.450.0770.05019.28
5.4.440.0600.05019.57
5.4.430.0030.06019.10
5.4.420.0900.06319.63
5.4.410.0930.06319.50
5.4.400.0670.05718.81
5.4.390.0670.05319.12
5.4.380.0400.04718.51
5.4.370.0470.05718.56
5.4.360.0430.05018.50
5.4.350.0400.05318.50
5.4.340.0230.05718.59
5.4.320.0050.03712.45
5.4.310.0050.04312.45
5.4.300.0080.05012.46
5.4.290.0050.05312.45
5.4.280.0040.03612.35
5.4.270.0100.03612.35
5.4.260.0100.03912.35
5.4.250.0080.03512.35
5.4.240.0050.03712.35
5.4.230.0040.03912.34
5.4.220.0040.04012.34
5.4.210.0050.03612.34
5.4.200.0050.03812.34
5.4.190.0450.08012.34
5.4.180.0140.04612.34
5.4.170.0320.09112.35
5.4.160.0340.09312.34
5.4.150.0320.09412.34
5.4.140.0490.11712.02
5.4.130.0220.04512.01
5.4.120.0300.09711.97
5.4.110.0250.04311.96
5.4.100.0180.04611.96
5.4.90.0350.08911.96
5.4.80.0340.08811.96
5.4.70.0260.09611.96
5.4.60.0150.04311.96
5.4.50.0170.04411.96
5.4.40.0150.04411.95
5.4.30.0090.04911.95
5.4.20.0120.04511.95
5.4.10.0180.03911.94
5.4.00.0180.04011.44
5.3.290.0090.03712.80
5.3.280.0060.03712.71
5.3.270.0180.04712.72
5.3.260.0140.04812.72
5.3.250.0100.05012.72
5.3.240.0150.04712.72
5.3.230.0170.04512.71
5.3.220.0170.04512.68
5.3.210.0130.05112.68
5.3.200.0160.04712.68
5.3.190.0190.04312.68
5.3.180.0180.04312.67
5.3.170.0150.04512.66
5.3.160.0150.04512.67
5.3.150.0340.08912.68
5.3.140.0200.04312.66
5.3.130.0180.04412.66
5.3.120.0160.04512.66
5.3.110.0150.04712.66
5.3.100.0220.04712.12
5.3.90.0220.03812.09
5.3.80.0120.04912.07
5.3.70.0180.04412.08
5.3.60.0140.04812.07
5.3.50.0180.04412.00
5.3.40.0150.04912.00
5.3.30.0430.08011.96
5.3.20.0200.04511.73
5.3.10.0160.04711.69
5.3.00.0300.06611.68
5.2.170.0220.0319.19
5.2.160.0170.0359.18
5.2.150.0170.0379.18
5.2.140.0150.0359.18
5.2.130.0130.0399.14
5.2.120.0120.0409.14
5.2.110.0130.0409.15
5.2.100.0170.0369.14
5.2.90.0290.0539.14
5.2.80.0200.0319.14
5.2.70.0140.0409.13
5.2.60.0140.0409.09
5.2.50.0160.0399.06
5.2.40.0250.0579.04
5.2.30.0090.0409.01
5.2.20.0380.0749.00
5.2.10.0130.0368.93
5.2.00.0350.0788.78
5.1.60.0180.0258.07
5.1.50.0410.0678.06
5.1.40.0140.0298.05
5.1.30.0130.0338.39
5.1.20.0140.0318.43
5.1.10.0110.0348.14
5.1.00.0170.0278.14
5.0.50.0120.0246.63
5.0.40.0130.0216.48
5.0.30.0110.0366.29
5.0.20.0100.0256.27
5.0.10.0130.0236.24
5.0.00.0190.0606.24
4.4.90.0120.0164.78
4.4.80.0120.0174.76
4.4.70.0090.0194.75
4.4.60.0100.0174.75
4.4.50.0120.0154.77
4.4.40.0080.0304.70
4.4.30.0120.0154.76
4.4.20.0090.0184.84
4.4.10.0100.0184.85
4.4.00.0100.0284.76
4.3.110.0100.0174.67
4.3.100.0080.0184.67
4.3.90.0090.0174.64
4.3.80.0100.0274.58
4.3.70.0030.0224.63
4.3.60.0120.0154.63
4.3.50.0040.0224.63
4.3.40.0060.0304.54
4.3.30.0060.0193.29
4.3.20.0050.0193.28
4.3.10.0070.0203.24
4.3.00.0170.0277.39

preferences:
50.08 ms | 401 KiB | 5 Q