3v4l.org

run code in 300+ PHP versions simultaneously
<?php function seek(&$arr, $key){ $offset = 0; while(key($arr) !== $key){ next($arr); $offset++; } return $offset; } $arr = [ 'a' => 10, 'b' => 11, 'c' => 12, 'd' => 13, 'e' => 14, ]; $offset = seek($arr, 'c'); var_dump($offset); var_dump(key($arr)); var_dump(current($arr));

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.0070.01116.63
8.3.60.0120.00418.20
8.3.50.0120.00721.87
8.3.40.0030.01018.85
8.3.30.0110.00318.55
8.3.20.0060.00319.39
8.3.10.0080.00021.93
8.3.00.0090.00020.72
8.2.190.0110.00416.63
8.2.180.0140.00718.16
8.2.170.0060.01222.96
8.2.160.0040.01119.01
8.2.150.0050.00324.18
8.2.140.0070.00024.66
8.2.130.0060.00326.16
8.2.120.0050.00219.76
8.2.110.0030.00621.00
8.2.100.0070.00417.52
8.2.90.0000.00719.06
8.2.80.0080.00017.97
8.2.70.0030.00617.50
8.2.60.0030.00518.03
8.2.50.0000.00818.10
8.2.40.0090.00020.66
8.2.30.0040.00419.19
8.2.20.0080.00017.50
8.2.10.0040.00417.97
8.2.00.0000.00718.12
8.1.280.0110.00525.92
8.1.270.0040.00423.83
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00323.65
8.1.230.0130.00022.68
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0030.00617.11
8.1.190.0030.00617.10
8.1.180.0070.00018.10
8.1.170.0030.00618.50
8.1.160.0080.00018.98
8.1.150.0050.00218.75
8.1.140.0080.00019.43
8.1.130.0000.00717.63
8.1.120.0040.00417.43
8.1.110.0040.00417.29
8.1.100.0070.00017.46
8.1.90.0030.00617.39
8.1.80.0040.00417.36
8.1.70.0000.00817.37
8.1.60.0060.00317.50
8.1.50.0000.00917.41
8.1.40.0000.00717.54
8.1.30.0060.00317.70
8.1.20.0020.00517.59
8.1.10.0000.00817.51
8.1.00.0040.00417.41
8.0.300.0000.00718.77
8.0.290.0040.00416.63
8.0.280.0000.00718.39
8.0.270.0040.00417.11
8.0.260.0000.00717.20
8.0.250.0080.00016.75
8.0.240.0030.00316.89
8.0.230.0000.00816.89
8.0.220.0030.00316.83
8.0.210.0040.00416.72
8.0.200.0030.00616.83
8.0.190.0000.00916.90
8.0.180.0070.00016.80
8.0.170.0000.00816.85
8.0.160.0030.00316.71
8.0.150.0030.00316.66
8.0.140.0040.00416.76
8.0.130.0050.00013.26
8.0.120.0000.00816.73
8.0.110.0070.00016.81
8.0.100.0040.00416.83
8.0.90.0070.00016.87
8.0.80.0030.01416.82
8.0.70.0080.00016.73
8.0.60.0050.00316.68
8.0.50.0040.00416.77
8.0.30.0080.00817.33
8.0.20.0050.01317.40
8.0.10.0030.00616.92
8.0.00.0100.00716.50
7.4.330.0050.00015.08
7.4.320.0030.00316.60
7.4.300.0060.00016.52
7.4.290.0050.00216.42
7.4.280.0000.00816.59
7.4.270.0070.00016.54
7.4.260.0080.00016.49
7.4.250.0000.00716.52
7.4.240.0000.00716.46
7.4.230.0070.00016.40
7.4.220.0040.01516.55
7.4.210.0070.00716.55
7.4.200.0040.00416.50
7.4.160.0070.01516.73
7.4.150.0120.01217.40
7.4.140.0110.00717.86
7.4.130.0110.00616.59
7.4.120.0130.00516.55
7.4.110.0130.00316.36
7.4.100.0030.01416.55
7.4.90.0130.00416.55
7.4.80.0130.00319.39
7.4.70.0110.00416.52
7.4.60.0070.01116.61
7.4.50.0070.01016.66
7.4.40.0170.00616.71
7.4.30.0080.00816.46
7.4.00.0050.00814.92
7.3.330.0060.00013.28
7.3.320.0000.00613.20
7.3.310.0000.00716.16
7.3.300.0070.00016.30
7.3.290.0080.00716.29
7.3.280.0090.00916.33
7.3.270.0170.00317.40
7.3.260.0090.00916.33
7.3.250.0100.01416.44
7.3.240.0130.00816.54
7.3.230.0060.01716.54
7.3.210.0030.01316.23
7.3.200.0030.01316.54
7.3.190.0030.01316.47
7.3.180.0180.00316.53
7.3.170.0050.01116.23
7.3.160.0060.00916.64
7.3.120.0070.01015.05
7.3.110.0060.00914.86
7.3.100.0140.00314.84
7.3.90.0060.00914.79
7.3.80.0070.01015.03
7.3.70.0000.00914.72
7.3.60.0090.00614.75
7.3.50.0030.01414.66
7.3.40.0000.01114.76
7.3.30.0030.01214.55
7.3.20.0030.00716.52
7.3.10.0100.00316.70
7.3.00.0060.00916.53
7.2.330.0030.01416.39
7.2.320.0140.01116.45
7.2.310.0100.01016.68
7.2.300.0140.00916.70
7.2.290.0040.01216.58
7.2.250.0070.01415.02
7.2.240.0100.01014.96
7.2.230.0030.01415.14
7.2.220.0030.00715.15
7.2.210.0030.00915.19
7.2.200.0090.00615.14
7.2.190.0090.00615.00
7.2.180.0070.01114.78
7.2.170.0130.00014.98
7.2.00.0030.00619.20
7.1.330.0030.01416.03
7.1.320.0040.00715.67
7.1.310.0030.00715.82
7.1.300.0100.00315.59
7.1.290.0070.00315.89
7.1.280.0060.00615.51
7.1.270.0060.00915.81
7.1.260.0090.00616.03
7.1.100.0070.00418.30
7.1.70.0000.00717.34
7.1.60.0130.00919.90
7.1.00.0030.07722.51
7.0.200.0000.00816.57
7.0.70.1130.05019.86
7.0.60.1270.05720.04
7.0.50.1170.06020.38
7.0.40.1030.06020.36
7.0.30.1170.05020.37
7.0.20.1030.06020.31
7.0.10.1270.05320.34
7.0.00.1170.05320.44
5.6.280.0070.07021.15
5.6.220.0900.06020.80
5.6.210.1270.03720.52
5.6.200.0870.07021.20
5.6.190.0970.05021.07
5.6.180.1100.05321.20
5.6.170.0830.06721.18
5.6.160.0800.06721.02
5.6.150.0900.06020.96
5.6.140.0900.05721.02
5.6.130.0970.05021.11
5.6.120.0170.05321.07
5.6.110.0400.06721.13
5.6.100.1130.05721.08
5.6.90.1130.05021.06
5.6.80.1200.06720.53
5.6.70.1200.05320.48
5.6.60.1230.04720.54
5.6.50.1100.07320.56
5.6.40.1130.05020.52
5.6.30.1100.05320.49
5.6.20.0830.06020.38
5.6.10.0870.05320.55
5.6.00.0970.06320.47
5.5.360.0630.06720.50
5.5.350.1030.06020.42
5.5.340.0900.05020.95
5.5.330.1100.06020.82
5.5.320.0900.05720.95
5.5.310.0830.06020.86
5.5.300.1070.05320.89
5.5.290.1100.07020.79
5.5.280.0030.06320.86
5.5.270.1070.05720.95
5.5.260.1130.05720.91
5.5.250.1070.05320.74
5.5.240.0970.06320.34
5.5.230.1030.04720.36
5.5.220.0900.05720.29
5.5.210.0930.05320.18
5.5.200.1330.05720.28
5.5.190.1170.06020.30
5.5.180.1070.06720.32
5.5.160.0870.05720.27
5.5.150.0900.05020.27
5.5.140.1030.05720.30
5.5.130.1330.06720.14
5.5.120.1030.05320.05
5.5.110.1030.05720.18
5.5.100.1070.05320.24
5.5.90.1170.04320.14
5.5.80.0900.06720.04
5.5.70.1070.05320.20
5.5.60.0930.06020.14
5.5.50.0100.05320.12
5.5.40.0200.05020.21
5.5.30.0170.07319.99
5.5.20.0730.05719.95
5.5.10.0970.04320.18
5.5.00.0800.06020.09

preferences:
33.01 ms | 401 KiB | 5 Q