3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getFor($i) { $srt=""; $array = [1,2,3,2,4,1,1,2,3]; while ($arr= current($array)) { if ($arr == '$i') { $srt.= "key=".key($array).'<br />'; } next($array); } } echo getFor(1);

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.0090.00618.13
8.3.60.0110.00718.54
8.3.50.0090.00922.13
8.3.40.0170.00018.74
8.3.30.0110.00418.63
8.3.20.0080.00020.20
8.3.10.0050.00323.48
8.3.00.0070.00417.63
8.2.190.0040.01116.58
8.2.180.0070.00716.63
8.2.170.0120.00922.96
8.2.160.0150.00019.10
8.2.150.0080.00824.18
8.2.140.0070.00024.66
8.2.130.0000.00722.21
8.2.120.0060.00326.35
8.2.110.0090.00020.37
8.2.100.0080.00317.78
8.2.90.0030.00619.21
8.2.80.0040.00417.97
8.2.70.0040.00417.50
8.2.60.0080.00017.93
8.2.50.0040.00418.10
8.2.40.0000.00822.12
8.2.30.0080.00319.12
8.2.20.0070.00717.55
8.2.10.0070.00018.21
8.2.00.0050.00317.98
8.1.280.0070.00725.92
8.1.270.0000.00823.91
8.1.260.0000.00728.09
8.1.250.0000.00728.09
8.1.240.0050.00522.18
8.1.230.0120.00020.60
8.1.220.0030.00517.74
8.1.210.0050.00318.77
8.1.200.0000.01017.35
8.1.190.0080.00017.22
8.1.180.0000.00818.10
8.1.170.0050.00318.71
8.1.160.0030.00322.09
8.1.150.0070.00020.59
8.1.140.0040.00419.55
8.1.130.0000.00717.70
8.1.120.0000.00717.45
8.1.110.0040.00417.33
8.1.100.0000.00717.36
8.1.90.0030.00617.50
8.1.80.0030.00517.34
8.1.70.0030.00317.45
8.1.60.0040.00417.63
8.1.50.0030.00517.49
8.1.40.0060.00317.47
8.1.30.0040.00417.56
8.1.20.0000.00817.61
8.1.10.0050.00217.50
8.1.00.0030.00617.45
8.0.300.0060.00318.77
8.0.290.0000.00916.75
8.0.280.0030.00518.44
8.0.270.0040.00417.17
8.0.260.0060.00017.25
8.0.250.0030.00616.95
8.0.240.0030.00317.02
8.0.230.0000.00916.84
8.0.220.0030.00516.93
8.0.210.0070.00016.91
8.0.200.0050.00316.98
8.0.190.0080.00016.92
8.0.180.0000.00716.90
8.0.170.0080.00016.82
8.0.160.0000.00816.84
8.0.150.0050.00216.81
8.0.140.0040.00416.87
8.0.130.0030.00313.35
8.0.120.0040.00416.71
8.0.110.0070.00016.79
8.0.100.0040.00416.75
8.0.90.0040.00416.89
8.0.80.0060.01516.77
8.0.70.0000.00716.73
8.0.60.0000.00716.93
8.0.50.0040.00416.88
8.0.30.0090.00917.23
8.0.20.0120.00717.40
8.0.10.0040.00416.92
8.0.00.0130.00416.54
7.4.330.0000.00515.08
7.4.320.0060.00016.48
7.4.300.0030.00316.40
7.4.290.0070.00016.49
7.4.280.0030.00916.58
7.4.270.0070.00016.52
7.4.260.0070.00016.50
7.4.250.0000.00716.49
7.4.240.0040.00416.49
7.4.230.0050.00316.49
7.4.220.0060.01516.71
7.4.210.0040.01116.51
7.4.200.0050.00216.48
7.4.160.0080.01616.41
7.4.150.0160.00317.40
7.4.140.0090.01017.86
7.4.130.0090.00916.55
7.4.120.0120.00516.53
7.4.110.0120.00916.71
7.4.100.0070.01016.45
7.4.90.0180.00016.57
7.4.80.0150.00619.39
7.4.70.0120.00616.48
7.4.60.0100.01016.44
7.4.50.0070.00716.36
7.4.40.0040.01416.57
7.4.30.0120.00916.52
7.4.00.0000.01415.22
7.3.330.0060.00013.30
7.3.320.0000.00613.30
7.3.310.0070.00016.34
7.3.300.0030.00316.31
7.3.290.0000.00716.30
7.3.280.0070.00916.29
7.3.270.0140.00317.40
7.3.260.0120.00616.53
7.3.250.0080.00916.35
7.3.240.0090.00816.45
7.3.230.0170.00016.45
7.3.210.0110.00716.29
7.3.200.0150.00316.61
7.3.190.0040.01216.45
7.3.180.0110.00516.29
7.3.170.0100.00616.54
7.3.160.0140.00316.41
7.3.10.0070.00816.70
7.3.00.0030.00916.51
7.2.330.0080.00816.71
7.2.320.0060.01316.78
7.2.310.0140.00416.73
7.2.300.0070.01016.61
7.2.290.0140.00616.41
7.2.130.0040.01116.90
7.2.120.0100.00516.78
7.2.110.0060.00616.92
7.2.100.0050.01016.83
7.2.90.0090.00416.89
7.2.80.0070.00716.89
7.2.70.0080.00816.88
7.2.60.0080.00616.90
7.2.50.0070.00816.85
7.2.40.0080.00616.77
7.2.30.0070.00516.94
7.2.20.0050.01016.46
7.2.10.0060.00816.71
7.2.00.0030.00917.69
7.1.250.0050.00815.66
7.1.200.0040.00415.90
7.1.100.0090.00918.25
7.1.70.0040.00417.12
7.1.60.0030.00719.26
7.1.00.0070.07322.45
7.0.200.2460.01014.82
7.0.80.0130.05720.01
7.0.70.0000.06719.96
7.0.60.0230.05320.14
7.0.50.0100.06320.36
7.0.40.0070.06020.35
7.0.30.0070.06720.32
7.0.20.0170.06020.36
7.0.10.0130.05720.45
7.0.00.0070.06320.31
5.6.230.0100.06320.71
5.6.220.0130.05720.62
5.6.210.0270.06720.87
5.6.200.0200.06021.03
5.6.190.0070.06321.13
5.6.180.0170.05321.10
5.6.170.0200.05721.10
5.6.160.0170.05321.21
5.6.150.0130.07021.18
5.6.140.0030.06721.05
5.6.130.0070.08021.14
5.6.120.0100.06021.02
5.6.110.0270.04721.07
5.6.100.0100.06021.08
5.6.90.0100.06321.09
5.6.80.0100.06020.47
5.6.70.0170.05320.52
5.6.60.0130.05320.47
5.6.50.0100.05720.57
5.6.40.0070.06320.44
5.6.30.0130.05020.43
5.6.20.0130.05320.46
5.6.10.0200.04720.38
5.6.00.0230.06020.38
5.5.370.0130.05320.46
5.5.360.0100.06320.42
5.5.350.0100.06020.52
5.5.340.0030.07020.89
5.5.330.0070.06320.71
5.5.320.0200.04720.93
5.5.310.0200.08320.86
5.5.300.0130.06020.93
5.5.290.0170.05720.91
5.5.280.0130.06020.89
5.5.270.0270.04320.70
5.5.260.0200.05020.91
5.5.250.0130.05720.75
5.5.240.0230.05320.34
5.5.230.0170.05320.29
5.5.220.0070.06320.09
5.5.210.0130.05020.26
5.5.200.0030.06020.24
5.5.190.0230.04720.19
5.5.180.0230.06720.21
5.5.160.0170.05020.25
5.5.150.0070.06720.28
5.5.140.0130.05320.18
5.5.130.0070.05720.32
5.5.120.0230.04320.20
5.5.110.0070.06020.31
5.5.100.0130.05720.13
5.5.90.0170.05320.23
5.5.80.0130.05320.23
5.5.70.0130.05320.01
5.5.60.0170.05020.22
5.5.50.0130.05320.00
5.5.40.0170.05320.13
5.5.30.0230.04320.22
5.5.20.0130.06020.00
5.5.10.0200.05020.11
5.5.00.0070.05720.08

preferences:
58.65 ms | 401 KiB | 5 Q