3v4l.org

run code in 300+ PHP versions simultaneously
<?php function seek(&$arr, $key, $strict = false){ $offset = 0; while( $strict ? key($arr) !== $key : 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.60.0130.00318.17
8.3.50.0170.00318.30
8.3.40.0070.00718.52
8.3.30.0110.00318.38
8.3.20.0080.00019.21
8.3.10.0040.00421.64
8.3.00.0080.00021.02
8.2.180.0070.01318.41
8.2.170.0110.00622.96
8.2.160.0100.01019.22
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00420.39
8.2.120.0070.00026.35
8.2.110.0030.00620.78
8.2.100.0040.00717.72
8.2.90.0000.00817.78
8.2.80.0040.00419.33
8.2.70.0050.00317.91
8.2.60.0040.00417.80
8.2.50.0050.00318.10
8.2.40.0070.00420.64
8.2.30.0000.00819.19
8.2.20.0000.00717.51
8.2.10.0040.00418.11
8.2.00.0070.00018.03
8.1.280.0100.00725.92
8.1.270.0000.00724.02
8.1.260.0070.00028.09
8.1.250.0030.00528.09
8.1.240.0000.00922.20
8.1.230.0070.00421.04
8.1.220.0030.00617.79
8.1.210.0030.00618.77
8.1.200.0000.00817.23
8.1.190.0060.00317.10
8.1.180.0040.00418.10
8.1.170.0040.00418.63
8.1.160.0000.00722.15
8.1.150.0000.00718.95
8.1.140.0030.00319.57
8.1.130.0000.00717.70
8.1.120.0000.00717.35
8.1.110.0070.00017.46
8.1.100.0040.00317.35
8.1.90.0030.00617.34
8.1.80.0030.00517.47
8.1.70.0000.00717.49
8.1.60.0030.00617.55
8.1.50.0060.00317.41
8.1.40.0040.00417.52
8.1.30.0040.00417.59
8.1.20.0080.00017.70
8.1.10.0000.00817.42
8.1.00.0040.00417.50
8.0.300.0000.00819.86
8.0.290.0000.00716.58
8.0.280.0000.00718.38
8.0.270.0000.00717.20
8.0.260.0070.00017.23
8.0.250.0000.00716.88
8.0.240.0030.00316.90
8.0.230.0000.00816.80
8.0.220.0070.00016.76
8.0.210.0000.00716.87
8.0.200.0000.00916.89
8.0.190.0040.00416.78
8.0.180.0040.00416.77
8.0.170.0000.00716.86
8.0.160.0000.00816.91
8.0.150.0000.00716.84
8.0.140.0080.00016.81
8.0.130.0000.00613.21
8.0.120.0040.00416.88
8.0.110.0050.00216.88
8.0.100.0000.00716.86
8.0.90.0040.00416.82
8.0.80.0120.00916.75
8.0.70.0040.00416.86
8.0.60.0040.00416.73
8.0.50.0000.00716.71
8.0.30.0090.01016.85
8.0.20.0110.00717.40
8.0.10.0040.00416.91
8.0.00.0080.00816.69
7.4.330.0050.00015.08
7.4.320.0030.00316.60
7.4.300.0030.00316.65
7.4.290.0070.00016.48
7.4.280.0000.00816.50
7.4.270.0040.00416.51
7.4.260.0030.00316.48
7.4.250.0050.00216.55
7.4.240.0000.00716.52
7.4.230.0000.00716.58
7.4.220.0110.00816.54
7.4.210.0030.01016.63
7.4.200.0040.00416.69
7.4.160.0150.00616.32
7.4.150.0180.00617.40
7.4.140.0090.00917.86
7.4.130.0100.00616.51
7.4.120.0130.00516.49
7.4.110.0130.00316.43
7.4.100.0090.01216.38
7.4.90.0160.00616.52
7.4.80.0090.00819.39
7.4.70.0060.00916.67
7.4.60.0140.00616.48
7.4.50.0130.00316.49
7.4.40.0080.00916.39
7.4.30.0100.00716.53
7.4.00.0070.00714.66
7.3.330.0030.00313.32
7.3.320.0000.00613.12
7.3.310.0070.00016.15
7.3.300.0000.00716.31
7.3.290.0060.00816.29
7.3.280.0090.00916.26
7.3.270.0140.00417.40
7.3.260.0070.01416.36
7.3.250.0120.00616.36
7.3.240.0090.01016.32
7.3.230.0070.01016.39
7.3.210.0070.01616.45
7.3.200.0090.00616.59
7.3.190.0080.00816.29
7.3.180.0120.01016.34
7.3.170.0130.00316.34
7.3.160.0160.00316.47
7.3.120.0030.01015.00
7.3.110.0100.00714.50
7.3.100.0040.01114.64
7.3.90.0000.00714.75
7.3.80.0100.00715.08
7.3.70.0030.00714.99
7.3.60.0040.00814.61
7.3.50.0030.00715.01
7.3.40.0030.00614.78
7.3.30.0060.00614.83
7.3.20.0060.00716.58
7.3.10.0050.00816.80
7.3.00.0050.00716.68
7.2.330.0100.00716.65
7.2.320.0130.00316.39
7.2.310.0090.01116.62
7.2.300.0100.00616.52
7.2.290.0060.01116.60
7.2.240.0100.00715.16
7.2.230.0060.00615.04
7.2.220.0050.00514.84
7.2.210.0030.01314.62
7.2.200.0030.00914.88
7.2.190.0080.00415.00
7.2.180.0030.01214.93
7.2.170.0030.00714.83
7.2.160.0070.00714.88
7.2.150.0070.00716.96
7.2.140.0060.00616.85
7.2.130.0110.00316.91
7.2.120.0060.00716.71
7.2.110.0050.00616.82
7.2.100.0080.00616.80
7.2.90.0030.01116.82
7.2.80.0030.00717.00
7.2.70.0080.00816.68
7.2.60.0090.00916.70
7.2.50.0050.00716.88
7.2.40.0060.00916.81
7.2.30.0020.01316.85
7.2.20.0110.00316.61
7.2.10.0020.01016.85
7.2.00.0080.00316.75
7.1.330.0050.00615.77
7.1.320.0030.00715.79
7.1.310.0030.01215.96
7.1.300.0030.00715.73
7.1.290.0030.01215.89
7.1.280.0080.00315.98
7.1.270.0090.00315.88
7.1.260.0000.01015.67
7.1.250.0020.01315.86
7.1.100.0030.01018.46
7.1.70.0070.00017.29
7.1.60.0210.00319.90
7.1.00.0100.07022.54
7.0.200.0000.00716.75
7.0.70.1230.05319.96
7.0.60.1130.06719.98
7.0.50.1330.05020.39
7.0.40.1100.07020.27
7.0.30.1000.06720.38
7.0.20.1100.05720.44
7.0.10.1100.05720.28
7.0.00.1070.05720.36
5.6.280.0100.06721.11
5.6.220.1030.07020.58
5.6.210.0970.06720.73
5.6.200.1070.06021.14
5.6.190.0930.06321.02
5.6.180.0970.06021.08
5.6.170.1030.08321.08
5.6.160.1200.04721.08
5.6.150.1130.05721.18
5.6.140.1100.07721.07
5.6.130.1200.05721.11
5.6.120.0200.07021.02
5.6.110.0400.05721.16
5.6.100.1100.05721.01
5.6.90.1100.05721.00
5.6.80.1030.06320.40
5.6.70.0130.06320.50
5.6.60.0100.05320.41
5.6.50.1030.06020.46
5.6.40.1130.05020.35
5.6.30.0900.05020.48
5.6.20.1330.04720.53
5.6.10.1030.04720.50
5.6.00.0930.05020.44
5.5.360.0800.04720.40
5.5.350.0900.06720.42
5.5.340.1070.06020.70
5.5.330.0930.05720.95
5.5.320.0930.05320.93
5.5.310.1000.05320.79
5.5.300.1130.06020.93
5.5.290.1200.06320.86
5.5.280.0270.06720.89
5.5.270.0970.05320.69
5.5.260.0970.06720.85
5.5.250.1030.06020.77
5.5.240.1030.07320.24
5.5.230.0170.05320.34
5.5.220.0530.06020.16
5.5.210.0900.05720.22
5.5.200.1170.04320.29
5.5.190.1070.07020.04
5.5.180.1100.04720.15
5.5.160.1100.05020.33
5.5.150.0930.05720.30
5.5.140.1030.05020.29
5.5.130.0930.06020.19
5.5.120.1400.05020.14
5.5.110.1100.08320.28
5.5.100.0930.07020.23
5.5.90.1270.07320.17
5.5.80.1370.07320.13
5.5.70.1300.08020.21
5.5.60.1070.07320.14
5.5.50.1170.06020.02
5.5.40.1200.04320.08
5.5.30.0870.05720.04
5.5.20.1070.05720.17
5.5.10.1070.06720.12
5.5.00.0930.04720.08

preferences:
89.49 ms | 401 KiB | 5 Q