3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red'); $key = array_search('green', $array); // $key = 2; echo $key; $key = array_search('red', $array); // $key = 1;4

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.0110.01118.31
8.3.50.0180.00821.88
8.3.40.0060.00918.59
8.3.30.0000.01518.92
8.3.20.0040.00420.25
8.3.10.0090.00022.09
8.3.00.0040.00422.46
8.2.180.0100.01016.38
8.2.170.0120.00322.96
8.2.160.0150.00020.81
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0050.00219.76
8.2.110.0130.00322.25
8.2.100.0030.00717.78
8.2.90.0000.00819.23
8.2.80.0030.00517.97
8.2.70.0070.00317.63
8.2.60.0070.00017.80
8.2.50.0080.00018.07
8.2.40.0040.00418.22
8.2.30.0000.00718.06
8.2.20.0020.00517.65
8.2.10.0030.00619.59
8.2.00.0070.00017.65
8.1.280.0100.01025.92
8.1.270.0070.00023.96
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0090.01223.79
8.1.230.0070.00319.15
8.1.220.0000.00917.74
8.1.210.0040.00418.77
8.1.200.0050.00517.13
8.1.190.0070.00017.43
8.1.180.0040.00418.10
8.1.170.0000.00818.52
8.1.160.0040.00421.97
8.1.150.0040.00418.57
8.1.140.0000.00717.29
8.1.130.0060.00017.82
8.1.120.0050.00217.39
8.1.110.0030.00617.35
8.1.100.0040.00317.39
8.1.90.0000.00817.28
8.1.80.0030.00617.25
8.1.70.0030.00317.25
8.1.60.0000.00717.52
8.1.50.0000.00717.32
8.1.40.0000.00717.42
8.1.30.0060.00317.46
8.1.20.0000.00717.48
8.1.10.0040.00417.52
8.1.00.0040.00417.36
8.0.300.0070.00018.77
8.0.290.0000.00716.93
8.0.280.0000.00818.43
8.0.270.0000.00717.12
8.0.260.0030.00316.80
8.0.250.0030.00316.89
8.0.240.0000.00716.82
8.0.230.0040.00416.79
8.0.220.0030.00316.86
8.0.210.0030.00316.86
8.0.200.0060.00016.88
8.0.190.0050.00316.81
8.0.180.0060.00616.81
8.0.170.0070.00016.87
8.0.160.0050.00316.70
8.0.150.0030.00416.80
8.0.140.0070.00016.75
8.0.130.0000.00613.25
8.0.120.0040.00416.80
8.0.110.0070.00016.68
8.0.100.0030.00516.78
8.0.90.0070.00016.93
8.0.80.0150.00616.70
8.0.70.0030.00616.81
8.0.60.0000.00816.64
8.0.50.0040.00416.79
8.0.30.0130.00517.15
8.0.20.0090.01117.40
8.0.10.0000.00816.75
8.0.00.0110.01116.75
7.4.330.0020.00215.00
7.4.320.0000.00716.48
7.4.300.0040.00416.33
7.4.290.0060.00016.44
7.4.280.0000.00716.53
7.4.270.0000.00716.42
7.4.260.0070.00016.40
7.4.250.0050.00316.53
7.4.240.0030.00316.50
7.4.230.0050.00216.61
7.4.220.0120.00616.56
7.4.210.0080.00916.50
7.4.200.0000.00716.60
7.4.190.0070.00016.29
7.4.160.0030.01316.34
7.4.150.0080.01117.40
7.4.140.0130.00817.86
7.4.130.0110.00916.42
7.4.120.0100.00616.37
7.4.110.0130.01016.38
7.4.100.0130.00316.53
7.4.90.0120.00616.29
7.4.80.0100.00719.39
7.4.70.0060.00916.38
7.4.60.0060.01616.30
7.4.50.0000.00716.61
7.4.40.0070.01022.77
7.4.30.0090.00616.38
7.4.00.0060.00914.72
7.3.330.0050.00013.06
7.3.320.0020.00313.09
7.3.310.0030.00416.25
7.3.300.0030.00316.12
7.3.290.0070.01316.19
7.3.280.0110.00616.21
7.3.270.0100.00717.40
7.3.260.0100.00716.41
7.3.250.0080.01516.28
7.3.240.0090.00616.46
7.3.230.0110.00616.39
7.3.210.0140.00316.43
7.3.200.0070.01119.39
7.3.190.0120.00616.18
7.3.180.0080.00816.51
7.3.170.0000.01516.27
7.3.160.0090.01316.52
7.3.120.0070.00714.93
7.2.330.0090.01016.41
7.2.320.0090.01516.62
7.2.310.0070.01016.59
7.2.300.0110.00516.50
7.2.290.0130.00916.40
7.2.60.0030.00916.80
7.2.00.0060.00919.45
7.1.200.0030.00815.46
7.1.100.0030.01018.36
7.1.70.0060.01317.11
7.1.60.0060.01919.82
7.1.50.0060.01616.84
7.1.00.0100.07022.35
7.0.200.0120.00016.73
7.0.140.0070.07022.07
7.0.60.0130.07019.84
7.0.50.0070.07717.88
7.0.40.0030.09020.04
7.0.30.0200.05020.02
7.0.20.0270.08020.04
7.0.10.0070.07720.21
7.0.00.0100.08020.16
5.6.280.0100.06721.02
5.6.210.0130.03320.60
5.6.200.0000.05718.12
5.6.190.0100.03720.43
5.6.180.3200.03320.41
5.6.170.0300.07720.39
5.6.160.0100.07020.48
5.6.150.0070.08018.11
5.6.140.0030.07718.18
5.6.130.0100.05718.16
5.6.120.0070.08720.98
5.6.110.0030.08320.98
5.6.100.0030.08320.88
5.6.90.0170.06321.09
5.6.80.0170.07320.40
5.6.70.4170.04020.36
5.5.350.0100.07720.31
5.5.340.0000.04317.98
5.5.330.0100.06320.46
5.5.320.0270.05720.32
5.5.310.0200.07720.30
5.5.300.0030.04317.98
5.5.290.0030.07018.01
5.5.280.0070.05020.87
5.5.270.0030.06720.96
5.5.260.0000.04720.63
5.5.250.0070.06320.68
5.5.240.0300.07020.21
5.4.450.0670.04019.43
5.4.440.0330.04319.41
5.4.430.0530.03719.40
5.4.420.0300.03719.21
5.4.410.0070.05718.93
5.4.400.0130.04718.73
5.4.390.0030.05718.77
5.4.380.0170.05718.65
5.4.370.0100.06018.45
5.4.360.0270.04718.52
5.4.350.0130.06018.68
5.4.340.0330.05018.72
5.4.320.0030.03912.45
5.4.310.0060.03812.45
5.4.300.0110.04112.45
5.4.290.0090.05012.45
5.4.280.0060.04112.34
5.4.270.0060.04012.31
5.4.260.0080.03812.32
5.4.250.0070.03912.31
5.4.240.0040.03812.32
5.4.230.0080.03912.31
5.4.220.0080.03412.31
5.4.210.0050.03912.30
5.4.200.0110.03412.31
5.4.190.0060.04012.30
5.4.180.0070.03612.30
5.4.170.0070.03712.31
5.4.160.0050.03812.30
5.4.150.0050.03912.30
5.4.140.0060.05211.98
5.4.130.0070.04311.98
5.4.120.0060.04111.93
5.4.110.0050.03611.93
5.4.100.0060.03511.93
5.4.90.0050.03811.93
5.4.80.0070.04111.93
5.4.70.0060.03311.92
5.4.60.0090.03811.93
5.4.50.0060.04011.92
5.4.40.0070.03411.91
5.4.30.0050.03611.91
5.4.20.0080.03611.91
5.4.10.0030.03811.91
5.4.00.0060.03711.40
5.3.290.0100.04512.80
5.3.280.0070.03912.71
5.3.270.0060.04112.72
5.3.260.0060.04112.72
5.3.250.0050.04212.72
5.3.240.0050.04112.72
5.3.230.0080.03812.70
5.3.220.0080.04012.68
5.3.210.0050.04312.68
5.3.200.0070.04112.68
5.3.190.0070.03812.68
5.3.180.0090.04312.67
5.3.170.0090.05112.67
5.3.160.0070.05212.68
5.3.150.0100.03712.67
5.3.140.0080.04012.66
5.3.130.0130.06612.65
5.3.120.0040.05712.66
5.3.110.0080.05112.66
5.3.100.0060.03712.12
5.3.90.0050.03712.09
5.3.80.0070.03912.07
5.3.70.0070.04212.08
5.3.60.0050.04412.07
5.3.50.0030.04012.00
5.3.40.0100.03412.00
5.3.30.0110.03811.94
5.3.20.0060.04611.70
5.3.10.0050.03811.66
5.3.00.0070.04611.64
5.2.170.0070.0459.14
5.2.160.0050.0429.15
5.2.150.0050.0319.15
5.2.140.0060.0309.14
5.2.130.0070.0279.11
5.2.120.0060.0279.10
5.2.110.0090.0339.11
5.2.100.0110.0479.11
5.2.90.0030.0409.11
5.2.80.0070.0369.10
5.2.70.0030.0329.09
5.2.60.0060.0329.05
5.2.50.0070.0369.02
5.2.40.0070.0339.00
5.2.30.0040.0328.98
5.2.20.0040.0308.96
5.2.10.0020.0338.90
5.2.00.0070.0288.77
5.1.60.0030.0298.05
5.1.50.0050.0248.04
5.1.40.0080.0218.03
5.1.30.0030.0288.38
5.1.20.0050.0278.41
5.1.10.0040.0288.12
5.1.00.0110.0208.11
5.0.50.0050.0206.60
5.0.40.0040.0236.46
5.0.30.0050.0316.28
5.0.20.0030.0216.25
5.0.10.0010.0236.23
5.0.00.0050.0336.22
4.4.90.0020.0184.78
4.4.80.0030.0154.76
4.4.70.0050.0144.76
4.4.60.0040.0154.76
4.4.50.0070.0124.77
4.4.40.0020.0284.71
4.4.30.0040.0154.76
4.4.20.0030.0174.85
4.4.10.0060.0144.85
4.4.00.0010.0294.76
4.3.110.0040.0214.67
4.3.100.0050.0154.67
4.3.90.0030.0164.63
4.3.80.0020.0264.58
4.3.70.0050.0134.63
4.3.60.0040.0144.63
4.3.50.0040.0154.63
4.3.40.0030.0254.54
4.3.30.0020.0173.28
4.3.20.0020.0173.26
4.3.10.0030.0163.23
4.3.00.0070.01315.05

preferences:
36.75 ms | 401 KiB | 5 Q