3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'maríaé'; function substr_count_array( $haystack, $needle ) { foreach ($needle as $substring) { $count[$substring] += substr_count( $haystack, $substring); } return $count; } print_r(substr_count_array($str, array("á","é","í","ó")));

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.0100.01016.88
8.3.60.0100.00716.88
8.3.50.0140.00923.00
8.3.40.0140.00018.84
8.3.30.0090.00619.19
8.3.20.0060.00320.25
8.3.10.0080.00023.69
8.3.00.0080.00019.50
8.2.180.0070.01118.06
8.2.170.0070.00722.96
8.2.160.0030.01020.38
8.2.150.0000.00824.18
8.2.140.0050.00324.66
8.2.130.0060.00326.16
8.2.120.0040.00421.11
8.2.110.0000.00922.04
8.2.100.0120.00317.84
8.2.90.0060.00317.88
8.2.80.0040.00418.05
8.2.70.0000.00818.05
8.2.60.0090.00018.05
8.2.50.0060.00319.31
8.2.40.0030.00720.42
8.2.30.0050.00218.14
8.2.20.0050.00317.74
8.2.10.0000.00817.98
8.2.00.0040.00417.80
8.1.280.0070.00725.92
8.1.270.0050.00323.84
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.97
8.1.230.0040.00820.79
8.1.220.0000.00917.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0040.00417.22
8.1.180.0040.00418.10
8.1.170.0050.00318.51
8.1.160.0000.00722.02
8.1.150.0050.00318.93
8.1.140.0040.00417.52
8.1.130.0070.00017.89
8.1.120.0030.00317.32
8.1.110.0040.00417.49
8.1.100.0000.00817.46
8.1.90.0000.00817.49
8.1.80.0000.00817.37
8.1.70.0030.00317.40
8.1.60.0040.00417.61
8.1.50.0040.00417.53
8.1.40.0090.00017.44
8.1.30.0050.00317.55
8.1.20.0040.00417.49
8.1.10.0040.00417.61
8.1.00.0070.00017.43
8.0.300.0040.00419.60
8.0.290.0040.00416.75
8.0.280.0000.00718.35
8.0.270.0000.00817.32
8.0.260.0040.00417.29
8.0.250.0000.00716.93
8.0.240.0000.00717.07
8.0.230.0000.00716.90
8.0.220.0000.00717.01
8.0.210.0030.00316.83
8.0.200.0000.00716.91
8.0.190.0070.00016.85
8.0.180.0040.00317.01
8.0.170.0040.00416.96
8.0.160.0000.00716.96
8.0.150.0040.00416.96
8.0.140.0040.00416.92
8.0.130.0030.00313.39
8.0.120.0030.00516.96
8.0.110.0050.00216.90
8.0.100.0000.00716.76
8.0.90.0040.00416.95
8.0.80.0080.00816.89
8.0.70.0050.00216.75
8.0.60.0000.00716.93
8.0.50.0000.00716.87
8.0.30.0060.01317.10
8.0.20.0110.00817.40
8.0.10.0040.00417.14
8.0.00.0100.01116.57
7.4.330.0000.00515.20
7.4.320.0030.00316.52
7.4.300.0030.00316.57
7.4.290.0000.00716.51
7.4.280.0030.00316.58
7.4.270.0060.00016.65
7.4.260.0060.00316.49
7.4.250.0000.00716.49
7.4.240.0030.00416.50
7.4.230.0030.00516.71
7.4.220.0130.00416.70
7.4.210.0090.00916.47
7.4.200.0070.00016.39
7.4.160.0090.01216.66
7.4.150.0030.01717.40
7.4.140.0070.01017.86
7.4.130.0080.01016.55
7.4.120.0170.00316.61
7.4.110.0110.00516.63
7.4.100.0100.01016.50
7.4.90.0070.01016.48
7.4.80.0150.00919.39
7.4.70.0100.00616.43
7.4.60.0130.00616.43
7.4.50.0050.00016.29
7.4.40.0030.01416.55
7.4.30.0080.00816.65
7.4.00.0090.00614.98
7.3.330.0060.00013.19
7.3.320.0000.00513.50
7.3.310.0000.00716.48
7.3.300.0040.00416.46
7.3.290.0030.01416.41
7.3.280.0070.01116.42
7.3.270.0060.01217.40
7.3.260.0190.00416.39
7.3.250.0120.00416.47
7.3.240.0120.00616.50
7.3.230.0060.01016.63
7.3.210.0050.01116.45
7.3.200.0060.01619.39
7.3.190.0100.00616.33
7.3.180.0090.00916.46
7.3.170.0110.00416.55
7.3.160.0100.00616.41
7.2.330.0090.00916.44
7.2.320.0100.00716.33
7.2.310.0060.01016.80
7.2.300.0090.00616.46
7.2.290.0110.00616.31
7.2.60.0040.00916.70
7.2.00.0000.01119.13
7.1.200.0080.00315.88
7.1.100.0040.00818.00
7.1.70.0030.00717.26
7.1.60.0140.01019.40
7.1.50.0190.00617.03
7.1.00.0070.07322.44
7.0.200.0030.00716.87
7.0.140.0030.07322.07
7.0.60.0030.06021.55
7.0.50.0070.04017.87
7.0.40.0070.08320.20
7.0.30.0330.07320.13
7.0.20.0270.05020.13
7.0.10.0070.08320.15
7.0.00.0170.07320.05
5.6.280.0000.07721.00
5.6.210.0170.07020.65
5.6.200.0130.07318.25
5.6.190.0030.05020.39
5.6.180.0330.04320.43
5.6.170.0400.05020.61
5.6.160.0170.07020.57
5.6.150.0070.09018.18
5.6.140.0130.07318.15
5.6.130.0130.07318.17
5.6.120.0200.07021.04
5.6.110.0030.04321.11
5.6.100.0100.07721.01
5.6.90.0170.07021.08
5.6.80.0130.06020.41
5.5.350.3900.04320.34
5.5.340.0030.04018.05
5.5.330.0030.06020.41
5.5.320.0330.06720.31
5.5.310.0230.04720.27
5.5.300.0130.07317.98
5.5.290.0070.08017.98
5.5.280.0030.04320.79
5.5.270.0070.03720.86
5.5.260.0130.06020.77
5.5.250.0070.08720.62
5.5.240.3430.04320.07
5.4.450.0930.06319.39
5.4.440.0600.06319.23
5.4.430.0070.05719.43
5.4.420.0730.04719.23
5.4.410.0800.05719.15
5.4.400.0700.05719.32
5.4.390.0770.06018.93
5.4.380.0030.05318.55
5.4.370.0130.03318.70
5.4.360.0200.04718.63
5.4.350.0140.08212.02
5.4.340.0100.04012.02
5.4.320.0090.04312.51
5.4.310.0080.04312.50
5.4.300.0050.03612.50
5.4.290.0070.04812.50
5.4.280.0050.03512.40
5.4.270.0080.03512.39
5.4.260.0070.03512.40
5.4.250.0080.03812.40
5.4.240.0090.04212.39
5.4.230.0080.04812.39
5.4.220.0050.03812.39
5.4.210.0040.03812.39
5.4.200.0080.03612.39
5.4.190.0050.03912.39
5.4.180.0050.03812.39
5.4.170.0050.03712.39
5.4.160.0060.03612.39
5.4.150.0040.04312.39
5.4.140.0070.04212.07
5.4.130.0080.03512.06
5.4.120.0030.03712.02
5.4.110.0080.03412.01
5.4.100.0060.03512.01
5.4.90.0070.03512.01
5.4.80.0070.03612.01
5.4.70.0080.03212.01
5.4.60.0060.03912.01
5.4.50.0040.04012.01
5.4.40.0100.04112.00
5.4.30.0090.04512.00
5.4.20.0080.03311.99
5.4.10.0050.03512.00
5.4.00.0070.03411.48
5.3.290.0060.04012.80
5.3.280.0070.03612.70
5.3.270.0040.03912.72
5.3.260.0070.04212.72
5.3.250.0070.04512.72
5.3.240.0040.03912.71
5.3.230.0080.03412.71
5.3.220.0060.04012.68
5.3.210.0060.04312.68
5.3.200.0060.03612.68
5.3.190.0110.03712.68
5.3.180.0100.03812.68
5.3.170.0070.03412.66
5.3.160.0080.03412.68
5.3.150.0070.04312.67
5.3.140.0100.04212.66
5.3.130.0080.03612.66
5.3.120.0040.04212.65
5.3.110.0090.03512.66
5.3.100.0080.04112.12
5.3.90.0110.04112.09
5.3.80.0030.03812.09
5.3.70.0090.04612.09
5.3.60.0080.03512.07
5.3.50.0070.03512.03
5.3.40.0070.03712.02
5.3.30.0050.04011.98
5.3.20.0080.04511.76
5.3.10.0060.04311.73
5.3.00.0070.04711.71
5.2.170.0050.0309.21
5.2.160.0070.0279.21
5.2.150.0070.0289.21
5.2.140.0040.0309.21
5.2.130.0020.0329.17
5.2.120.0080.0249.17
5.2.110.0050.0359.18
5.2.100.0080.0339.18
5.2.90.0030.0319.18
5.2.80.0030.0329.18
5.2.70.0040.0319.18
5.2.60.0060.0289.12
5.2.50.0060.0369.10
5.2.40.0060.0279.07
5.2.30.0060.0279.04
5.2.20.0030.0309.04
5.2.10.0020.0308.94
5.2.00.0070.0278.80
5.1.60.0040.0248.09
5.1.50.0030.0258.08
5.1.40.0030.0348.06
5.1.30.0030.0268.42
5.1.20.0040.0268.44
5.1.10.0050.0358.16
5.1.00.0050.0248.16
5.0.50.0040.0266.63
5.0.40.0020.0246.50
5.0.30.0040.0316.31
5.0.20.0050.0176.27
5.0.10.0040.0296.25
5.0.00.0020.0326.25
4.4.90.0030.0194.78
4.4.80.0040.0224.75
4.4.70.0050.0184.76
4.4.60.0030.0154.75
4.4.50.0030.0144.77
4.4.40.0030.0344.71
4.4.30.0040.0144.76
4.4.20.0030.0154.84
4.4.10.0020.0164.85
4.4.00.0040.0344.76
4.3.110.0030.0214.66
4.3.100.0040.0144.66
4.3.90.0010.0244.63
4.3.80.0030.0244.58
4.3.70.0030.0184.63
4.3.60.0020.0154.63
4.3.50.0020.0164.62
4.3.40.0050.0284.54
4.3.30.0070.0173.30
4.3.20.0010.0163.28
4.3.10.0020.0153.24
4.3.00.0170.0207.93

preferences:
52.42 ms | 401 KiB | 5 Q