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; } return $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.0140.00718.43
8.3.50.0140.00418.30
8.3.40.0040.01118.76
8.3.30.0100.00318.87
8.3.20.0000.00820.22
8.3.10.0080.00021.64
8.3.00.0060.00318.98
8.2.180.0120.00618.05
8.2.170.0040.01122.96
8.2.160.0140.00422.25
8.2.150.0050.00524.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00718.00
8.2.110.0040.00721.18
8.2.100.0000.01218.03
8.2.90.0040.00417.91
8.2.80.0060.00317.97
8.2.70.0030.00617.63
8.2.60.0040.00817.77
8.2.50.0030.00518.07
8.2.40.0030.00618.16
8.2.30.0040.00418.20
8.2.20.0040.00417.86
8.2.10.0050.00318.14
8.2.00.0000.00717.75
8.1.280.0110.00325.92
8.1.270.0040.00419.08
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0070.00322.61
8.1.230.0080.00320.89
8.1.220.0080.00017.79
8.1.210.0080.00018.84
8.1.200.0070.00417.22
8.1.190.0000.00917.23
8.1.180.0080.00018.10
8.1.170.0050.00318.53
8.1.160.0040.00422.02
8.1.150.0070.00018.75
8.1.140.0040.00417.44
8.1.130.0050.00217.87
8.1.120.0000.00717.43
8.1.110.0040.00417.43
8.1.100.0080.00017.49
8.1.90.0080.00017.45
8.1.80.0000.00717.40
8.1.70.0030.00317.52
8.1.60.0060.00317.57
8.1.50.0120.00017.55
8.1.40.0000.00817.40
8.1.30.0000.00817.68
8.1.20.0000.00817.55
8.1.10.0030.00517.49
8.1.00.0070.00017.48
8.0.300.0070.00019.86
8.0.290.0060.00316.75
8.0.280.0000.00718.45
8.0.270.0050.00216.80
8.0.260.0030.00317.26
8.0.250.0030.00317.06
8.0.240.0030.00517.03
8.0.230.0070.00017.00
8.0.220.0040.00416.90
8.0.210.0030.00316.98
8.0.200.0050.00317.02
8.0.190.0040.00416.95
8.0.180.0040.00416.98
8.0.170.0000.00916.87
8.0.160.0000.00716.93
8.0.150.0070.00316.96
8.0.140.0030.00516.98
8.0.130.0060.00013.43
8.0.120.0000.00816.98
8.0.110.0040.00417.05
8.0.100.0070.00016.93
8.0.90.0040.00417.05
8.0.80.0090.00617.01
8.0.70.0030.00316.75
8.0.60.0000.00717.07
8.0.50.0040.00416.94
8.0.30.0140.01117.29
8.0.20.0120.00917.40
8.0.10.0050.00216.86
8.0.00.0080.00916.66
7.4.330.0050.00015.03
7.4.320.0060.00016.41
7.4.300.0040.00416.58
7.4.290.0040.00416.44
7.4.280.0000.00716.58
7.4.270.0070.00016.50
7.4.260.0040.00816.64
7.4.250.0040.00416.45
7.4.240.0060.00116.57
7.4.230.0030.00316.44
7.4.220.0090.00916.46
7.4.210.0060.00916.68
7.4.200.0000.00716.44
7.4.160.0130.00316.54
7.4.150.0120.00617.40
7.4.140.0130.00517.86
7.4.130.0070.01116.52
7.4.120.0100.00716.63
7.4.110.0180.00016.52
7.4.100.0060.01216.63
7.4.90.0090.00916.54
7.4.80.0070.01019.39
7.4.70.0140.00316.59
7.4.60.0030.01216.55
7.4.50.0000.00816.61
7.4.40.0030.01316.61
7.4.30.0070.01116.55
7.4.00.0090.00914.79
7.3.330.0040.00413.45
7.3.320.0000.00513.45
7.3.310.0070.00016.27
7.3.300.0000.00716.30
7.3.290.0030.01016.43
7.3.280.0120.00716.40
7.3.270.0140.00717.40
7.3.260.0070.01316.47
7.3.250.0080.00816.40
7.3.240.0100.00716.59
7.3.230.0000.02216.39
7.3.210.0030.01316.67
7.3.200.0140.00719.39
7.3.190.0100.00716.41
7.3.180.0150.00616.43
7.3.170.0120.00616.69
7.3.160.0110.00716.50
7.3.10.0040.00916.77
7.3.00.0090.00516.82
7.2.330.0090.00816.41
7.2.320.0070.01016.45
7.2.310.0030.01416.68
7.2.300.0090.01316.74
7.2.290.0030.01316.68
7.2.130.0080.00516.85
7.2.120.0070.00716.99
7.2.110.0020.01016.87
7.2.100.0080.00516.96
7.2.90.0080.00616.77
7.2.80.0050.00916.96
7.2.70.0030.01217.01
7.2.60.0060.00716.89
7.2.50.0070.00616.97
7.2.40.0030.01016.77
7.2.30.0080.00617.08
7.2.20.0040.00916.99
7.2.10.0110.00517.07
7.2.00.0050.00917.66
7.1.250.0050.00715.91
7.1.200.0000.01015.82
7.1.100.0000.01218.21
7.1.70.0030.00717.19
7.1.60.0130.01619.46
7.1.50.0000.02417.00
7.1.00.0000.08022.30
7.0.200.0050.00316.78
7.0.140.0030.06322.21
7.0.60.0070.05319.95
7.0.50.0100.06717.88
7.0.40.0030.04320.04
7.0.30.0300.07720.16
7.0.20.0130.05720.06
7.0.10.0100.05320.24
7.0.00.0130.06320.25
5.6.280.0000.07720.79
5.6.210.0070.07320.61
5.6.200.0130.08318.23
5.6.190.0000.04720.62
5.6.180.0500.06320.77
5.6.170.0070.05020.48
5.6.160.0100.04320.51
5.6.150.0100.08018.19
5.6.140.0070.08318.27
5.6.130.0030.04018.21
5.6.120.0170.04320.99
5.6.110.0000.04321.12
5.6.100.0170.07721.02
5.6.90.0030.06720.99
5.6.80.0130.04720.38
5.5.350.0170.04320.38
5.5.340.0070.08018.08
5.5.330.0070.09020.37
5.5.320.0100.07020.30
5.5.310.0270.07720.29
5.5.300.0100.04317.98
5.5.290.0000.04317.92
5.5.280.0030.05720.80
5.5.270.0070.07020.89
5.5.260.0130.05720.76
5.5.250.0030.04020.50
5.5.240.0030.08320.19
5.4.450.0700.06719.29
5.4.440.0170.05319.20
5.4.430.0130.06319.50
5.4.420.0030.06319.41
5.4.410.0070.05719.35
5.4.400.0000.06319.06
5.4.390.0330.06718.78
5.4.380.0370.06718.78
5.4.370.0170.06318.60
5.4.360.0370.04718.62
5.4.350.0270.05018.58
5.4.340.0130.06318.80
5.4.320.0270.05018.48
5.4.310.0130.06318.82
5.4.300.0400.04018.50
5.4.290.0330.04018.80
5.4.280.0230.06018.48
5.4.270.0300.04718.78
5.4.260.0300.04318.44
5.4.250.0270.06718.46
5.4.240.0200.07718.68
5.4.230.0200.05318.45
5.4.220.0300.05318.77
5.4.210.0200.05318.55
5.4.200.0230.04716.50
5.4.190.0430.06018.48
5.4.180.0230.05018.77
5.4.170.0170.06318.77
5.4.160.0300.05018.50
5.4.150.0170.06018.47
5.4.140.0270.05016.21
5.4.130.0170.05716.28
5.4.120.0130.06016.31
5.4.110.0270.04716.33
5.4.100.0230.06016.32
5.4.90.0230.05016.44
5.4.80.0200.05316.40
5.4.70.0230.05316.23
5.4.60.0300.04716.25
5.4.50.0270.04716.41
5.4.40.0200.06016.30
5.4.30.0270.04716.25
5.4.20.0400.03716.29
5.4.10.0230.05316.25
5.4.00.0230.04315.79
5.3.290.0270.04714.67
5.3.280.0330.04014.65
5.3.270.0170.05714.73
5.3.260.0200.05314.77
5.3.250.0200.06014.66
5.3.240.0170.05714.60
5.3.230.0170.06014.71
5.3.220.0270.04714.60
5.3.210.0130.06314.63
5.3.200.0200.05314.64
5.3.190.0270.05014.62
5.3.180.0300.04314.56
5.3.170.0170.05314.66
5.3.160.0130.06014.62
5.3.150.0270.05014.79
5.3.140.0270.04714.60
5.3.130.0200.05714.58
5.3.120.0200.05314.75
5.3.110.0270.04714.57
5.3.100.0170.05714.06
5.3.90.0170.05314.00
5.3.80.0130.05314.15
5.3.70.0230.04714.00
5.3.60.0300.04014.05
5.3.50.0100.05713.97
5.3.40.0170.05014.08
5.3.30.0230.04713.97
5.3.20.0200.04713.79
5.3.10.0130.05713.71
5.3.00.0070.06713.66
5.2.170.0300.03011.21
5.2.160.0200.03711.14
5.2.150.0200.03711.16
5.2.140.0200.03711.20
5.2.130.0130.04311.14
5.2.120.0170.04011.13
5.2.110.0230.03711.31
5.2.100.0130.04711.16
5.2.90.0170.04311.10
5.2.80.0230.03711.17
5.2.70.0270.03311.11
5.2.60.0270.03311.14
5.2.50.0170.04311.15
5.2.40.0230.03011.07
5.2.30.0170.04011.00
5.2.20.0130.04010.98
5.2.10.0130.04010.86
5.2.00.0130.04010.78
5.1.60.0100.03710.10
5.1.50.0170.03010.13
5.1.40.0170.03010.05
5.1.30.0130.03310.38
5.1.20.0130.03310.43
5.1.10.0130.03310.11
5.1.00.0170.03010.07
5.0.50.0170.0208.59
5.0.40.0100.0278.55
5.0.30.0130.0378.41
5.0.20.0030.0308.20
5.0.10.0170.0208.27
5.0.00.0070.0438.28
4.4.90.0070.0235.91
4.4.80.0130.0305.90
4.4.70.0100.0205.87
4.4.60.0070.0235.92
4.4.50.0030.0275.93
4.4.40.0070.0335.91
4.4.30.0070.0205.93
4.4.20.0100.0205.95
4.4.10.0030.0236.09
4.4.00.0030.0376.04
4.3.110.0070.0205.88
4.3.100.0000.0275.94
4.3.90.0100.0205.80
4.3.80.0030.0375.78
4.3.70.0130.0135.81
4.3.60.0030.0235.80
4.3.50.0070.0235.81
4.3.40.0070.0335.75
4.3.30.0000.0334.54
4.3.20.0070.0204.57
4.3.10.0130.0134.54
4.3.00.0170.0177.19

preferences:
40.28 ms | 400 KiB | 5 Q