3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( "0001" => 80 , "0002" => 71 , "0003" => 99, "0004" => 55.5, "0005" => 66 ); $i=1; //function getPosition($id,$array){ $position = ''; foreach($array as $array1){ $keys = array_keys($array); // if($keys == $id){ // $position = $array1; //} $position .= $keys; } echo $position; //} //echo getPosition('0001',$array).'here';

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.0100.01018.50
8.3.50.0110.00921.98
8.3.40.0070.00718.60
8.3.30.0080.00619.04
8.3.20.0040.00420.07
8.3.10.0040.00421.66
8.3.00.0080.00019.07
8.2.180.0110.00718.06
8.2.170.0110.00422.96
8.2.160.0030.01422.27
8.2.150.0060.00324.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0080.00317.92
8.2.110.0040.00720.95
8.2.100.0090.00317.91
8.2.90.0050.00319.35
8.2.80.0080.00017.97
8.2.70.0040.00417.50
8.2.60.0040.00418.05
8.2.50.0060.00318.10
8.2.40.0040.00418.22
8.2.30.0030.00618.07
8.2.20.0000.00717.72
8.2.10.0070.00018.14
8.2.00.0030.00517.79
8.1.280.0120.00325.92
8.1.270.0090.00019.00
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0030.00724.03
8.1.230.0040.00817.83
8.1.220.0060.00317.77
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0040.00417.10
8.1.180.0040.00418.10
8.1.170.0080.00018.69
8.1.160.0000.00821.95
8.1.150.0070.00018.81
8.1.140.0040.00419.23
8.1.130.0070.00017.88
8.1.120.0000.00717.46
8.1.110.0060.00317.48
8.1.100.0040.00417.45
8.1.90.0040.00417.46
8.1.80.0040.00417.35
8.1.70.0030.00317.45
8.1.60.0040.00417.46
8.1.50.0030.00717.58
8.1.40.0040.00417.50
8.1.30.0030.00517.50
8.1.20.0040.00417.69
8.1.10.0040.00417.43
8.1.00.0000.00717.43
8.0.300.0040.00418.77
8.0.290.0030.00616.63
8.0.280.0030.00318.34
8.0.270.0030.00317.29
8.0.260.0040.00417.36
8.0.250.0030.00316.90
8.0.240.0030.00516.91
8.0.230.0000.00716.95
8.0.220.0000.00716.87
8.0.210.0000.00617.01
8.0.200.0000.00917.05
8.0.190.0040.00416.87
8.0.180.0000.00716.95
8.0.170.0000.00817.01
8.0.160.0030.00317.00
8.0.150.0040.00416.85
8.0.140.0000.00716.80
8.0.130.0060.00013.43
8.0.120.0000.00816.81
8.0.110.0040.00416.98
8.0.100.0040.00416.89
8.0.90.0000.00716.95
8.0.80.0160.00016.87
8.0.70.0050.00316.93
8.0.60.0080.00016.88
8.0.50.0000.00716.89
8.0.30.0110.01217.18
8.0.20.0110.00817.40
8.0.10.0050.00316.97
8.0.00.0100.00716.70
7.4.330.0000.00515.04
7.4.320.0060.00016.36
7.4.300.0030.00316.56
7.4.290.0040.00416.50
7.4.280.0000.00716.58
7.4.270.0000.00716.48
7.4.260.0030.00316.47
7.4.250.0020.00516.53
7.4.240.0030.00416.53
7.4.230.0030.00316.48
7.4.220.0120.00616.50
7.4.210.0150.00616.69
7.4.200.0000.00716.68
7.4.160.0080.01516.48
7.4.150.0090.00817.40
7.4.140.0070.01117.86
7.4.130.0100.00916.45
7.4.120.0090.00816.45
7.4.110.0060.01316.61
7.4.100.0130.01016.59
7.4.90.0070.01016.58
7.4.80.0090.01519.39
7.4.70.0080.01016.61
7.4.60.0160.00016.51
7.4.50.0050.00316.45
7.4.40.0060.01016.66
7.4.30.0070.01016.58
7.4.00.0140.00014.87
7.3.330.0080.00013.36
7.3.320.0000.00613.18
7.3.310.0070.00016.21
7.3.300.0000.00716.40
7.3.290.0130.00216.36
7.3.280.0110.00716.42
7.3.270.0030.01417.40
7.3.260.0170.00016.41
7.3.250.0130.00316.52
7.3.240.0110.00616.27
7.3.230.0090.01016.46
7.3.210.0070.01016.36
7.3.200.0060.01019.39
7.3.190.0060.00916.41
7.3.180.0120.00316.47
7.3.170.0130.01016.41
7.3.160.0150.00616.60
7.3.10.0070.00716.64
7.3.00.0040.00716.50
7.2.330.0110.00716.52
7.2.320.0070.01716.63
7.2.310.0030.01416.78
7.2.300.0120.01016.51
7.2.290.0070.01116.71
7.2.130.0080.00616.72
7.2.120.0070.00816.93
7.2.110.0080.00816.61
7.2.100.0060.01116.87
7.2.90.0110.00416.80
7.2.80.0050.00916.81
7.2.70.0060.00816.77
7.2.60.0070.00516.74
7.2.50.0080.01116.71
7.2.40.0100.00716.71
7.2.30.0060.00616.78
7.2.20.0080.01016.73
7.2.10.0090.00716.75
7.2.00.0040.00917.37
7.1.250.0080.00815.63
7.1.200.0200.00015.49
7.1.100.0070.00718.15
7.1.70.0000.01117.28
7.1.60.0070.01719.46
7.1.50.0130.01317.04
7.1.00.0100.07022.35
7.0.200.0070.00316.97
7.0.140.0000.05022.09
7.0.60.0030.06020.01
7.0.50.0030.08017.81
7.0.40.0200.07320.20
7.0.30.0130.07320.14
7.0.20.0070.05020.18
7.0.10.0030.09019.99
7.0.00.0070.06719.99
5.6.280.0130.06321.13
5.6.210.0030.04320.71
5.6.200.0070.04718.17
5.6.190.0170.03320.77
5.6.180.0370.04720.67
5.6.170.0370.08320.67
5.6.160.0030.06020.71
5.6.150.0030.09018.22
5.6.140.0130.07718.11
5.6.130.0030.09018.17
5.6.120.0000.04321.03
5.6.110.0100.03721.13
5.6.100.0030.06021.00
5.6.90.0030.07321.00
5.6.80.0070.05320.38
5.5.350.4300.04020.38
5.5.340.0100.04017.89
5.5.330.0100.07720.13
5.5.320.0430.07720.23
5.5.310.0300.07720.14
5.5.300.0170.06717.95
5.5.290.0170.07717.98
5.5.280.0100.07720.96
5.5.270.0030.07720.85
5.5.260.0070.08020.79
5.5.250.0100.03720.57
5.5.240.0230.03020.36
5.4.450.0030.05019.53
5.4.440.0070.06319.25
5.4.430.0070.08019.57
5.4.420.0070.08019.11
5.4.410.0000.08719.28
5.4.400.0030.03719.10
5.4.390.0070.07318.80
5.4.380.0100.06719.08
5.4.370.0070.06319.21
5.4.360.0000.04719.06
5.4.350.0000.07718.83
5.4.340.0070.04318.93
5.4.320.0130.06319.06
5.4.310.0030.06719.16
5.4.300.0070.07719.08
5.4.290.0070.06719.08
5.4.280.0070.06019.06
5.4.270.0070.07019.05
5.4.260.0000.06719.09
5.4.250.0000.07719.07
5.4.240.0000.05319.24
5.4.230.0000.06019.24
5.4.220.0030.07318.79
5.4.210.0030.06719.09
5.4.200.0070.07019.23
5.4.190.0000.03718.77
5.4.180.0000.04018.78
5.4.170.0000.03718.91
5.4.160.0030.03319.11
5.4.150.0000.03719.22
5.4.140.0030.03316.27
5.4.130.0000.03716.44
5.4.120.0000.03716.15
5.4.110.0030.03316.43
5.4.100.0000.04016.39
5.4.90.0100.04716.38
5.4.80.0000.03716.39
5.4.70.0030.05716.46
5.4.60.0000.03716.45
5.4.50.0000.03716.05
5.4.40.0030.03316.36
5.4.30.0000.03316.18
5.4.20.0030.03316.46
5.4.10.0070.03016.20
5.4.00.0000.03315.88
5.3.290.0070.07714.54
5.3.280.0000.07314.62
5.3.270.0100.03314.46
5.3.260.0000.04014.70
5.3.250.0030.03714.44
5.3.240.0030.03714.56
5.3.230.0030.03314.55
5.3.220.0000.04014.40
5.3.210.0000.03714.44
5.3.200.0070.03314.40
5.3.190.0000.04014.51
5.3.180.0070.03014.43
5.3.170.0000.03714.59
5.3.160.0030.03714.39
5.3.150.0030.03314.53
5.3.140.0030.03714.38
5.3.130.0000.04014.42
5.3.120.0000.03714.39
5.3.110.0030.03714.38
5.3.100.0070.03013.98
5.3.90.0000.03314.11
5.3.80.0070.02714.06
5.3.70.0030.03014.06
5.3.60.0030.03313.98
5.3.50.0000.03313.85
5.3.40.0000.03313.79
5.3.30.0030.03013.95
5.3.20.0000.03313.53
5.3.10.0000.03713.61
5.3.00.0000.04013.43
5.2.170.0070.02312.36
5.2.160.0000.02712.36
5.2.150.0000.03012.36
5.2.140.0000.03012.36
5.2.130.0030.02312.36
5.2.120.0030.02712.36
5.2.110.0030.02312.36
5.2.100.0000.03312.36
5.2.90.0000.02712.36
5.2.80.0000.02712.36
5.2.70.0000.03012.36
5.2.60.0030.04312.36
5.2.50.0000.06012.36
5.2.40.0070.05712.36
5.2.30.0100.05312.36
5.2.20.0030.05012.36
5.2.10.0030.05012.36
5.2.00.0000.06012.36
5.1.60.0030.05012.36
5.1.50.0030.03712.36
5.1.40.0030.03312.36
5.1.30.0070.04312.36
5.1.20.0030.04712.36
5.1.10.0070.05012.36
5.1.00.0030.05012.36
5.0.50.0000.04012.36
5.0.40.0070.03312.36
5.0.30.0030.06312.36
5.0.20.0030.02312.36
5.0.10.0000.03712.36
5.0.00.0000.05312.36
4.4.90.0000.01712.36
4.4.80.0000.03712.36
4.4.70.0030.02712.36
4.4.60.0030.02312.36
4.4.50.0000.02012.36
4.4.40.0030.04712.36
4.4.30.0000.03712.36
4.4.20.0070.02312.36
4.4.10.0000.02712.36
4.4.00.0000.05012.36
4.3.110.0000.02712.36
4.3.100.0030.02312.36
4.3.90.0000.02312.36
4.3.80.0000.05712.36
4.3.70.0030.03312.36
4.3.60.0030.02712.36
4.3.50.0000.03012.36
4.3.40.0000.05712.36
4.3.30.0000.03312.36
4.3.20.0000.03712.36
4.3.10.0000.03312.36
4.3.00.0000.02012.36

preferences:
37.03 ms | 401 KiB | 5 Q