3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'maríaé'; function substr_count_array( $haystack, $needle ) { //$count = 0; 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.60.0040.01216.75
8.3.50.0110.00722.85
8.3.40.0140.00018.79
8.3.30.0100.00319.07
8.3.20.0000.00720.39
8.3.10.0040.00423.51
8.3.00.0080.00019.51
8.2.180.0060.00918.29
8.2.170.0110.00422.96
8.2.160.0070.00720.43
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0050.00319.48
8.2.110.0090.00020.52
8.2.100.0070.00418.34
8.2.90.0060.00319.20
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0080.00017.80
8.2.50.0040.00418.07
8.2.40.0100.00018.16
8.2.30.0050.00318.07
8.2.20.0050.00317.88
8.2.10.0040.00418.00
8.2.00.0040.00417.62
8.1.280.0070.00725.92
8.1.270.0040.00423.66
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0040.00422.05
8.1.230.0060.00619.22
8.1.220.0040.00417.76
8.1.210.0040.00418.77
8.1.200.0000.01117.23
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0080.00018.72
8.1.160.0000.00721.93
8.1.150.0000.00918.90
8.1.140.0040.00417.45
8.1.130.0000.00717.83
8.1.120.0050.00217.51
8.1.110.0080.00017.31
8.1.100.0040.00417.38
8.1.90.0000.00717.52
8.1.80.0040.00417.39
8.1.70.0070.00017.40
8.1.60.0090.00017.48
8.1.50.0000.00917.52
8.1.40.0070.00317.38
8.1.30.0060.00317.64
8.1.20.0040.00417.68
8.1.10.0040.00417.50
8.1.00.0040.00417.50
8.0.300.0000.00818.77
8.0.290.0040.00416.75
8.0.280.0040.00418.44
8.0.270.0000.00717.25
8.0.260.0030.00317.25
8.0.250.0000.00717.03
8.0.240.0030.00317.03
8.0.230.0000.00817.03
8.0.220.0000.00717.00
8.0.210.0030.00316.95
8.0.200.0000.00616.93
8.0.190.0000.00817.00
8.0.180.0070.00016.86
8.0.170.0040.00417.04
8.0.160.0000.00717.02
8.0.150.0030.00316.82
8.0.140.0000.00716.86
8.0.130.0030.00313.34
8.0.120.0000.00816.91
8.0.110.0000.00716.86
8.0.100.0020.00516.95
8.0.90.0000.00716.89
8.0.80.0030.01216.88
8.0.70.0070.00016.97
8.0.60.0000.00717.00
8.0.50.0000.00716.91
8.0.30.0110.01117.16
8.0.20.0140.02217.40
8.0.10.0000.00816.98
8.0.00.0100.00716.67
7.4.330.0030.00315.15
7.4.320.0000.00616.60
7.4.300.0000.00616.58
7.4.290.0070.00016.50
7.4.280.0030.00316.64
7.4.270.0030.00316.62
7.4.260.0030.00316.58
7.4.250.0030.00516.57
7.4.240.0020.00416.56
7.4.230.0030.00316.40
7.4.220.0030.01916.71
7.4.210.0110.00416.53
7.4.200.0000.00716.58
7.4.160.0100.00716.59
7.4.150.0170.00017.40
7.4.140.0100.00817.86
7.4.130.0110.00816.53
7.4.120.0080.01216.49
7.4.110.0130.00316.41
7.4.100.0110.00716.70
7.4.90.0090.00916.56
7.4.80.0060.01719.39
7.4.70.0040.01516.67
7.4.60.0080.00816.42
7.4.50.0020.00216.46
7.4.40.0110.01116.51
7.4.30.0090.00616.67
7.4.00.0140.00314.88
7.3.330.0000.00713.38
7.3.320.0050.00013.31
7.3.310.0070.00016.24
7.3.300.0030.00316.38
7.3.290.0030.01216.42
7.3.280.0120.00416.42
7.3.270.0110.00617.40
7.3.260.0090.00916.35
7.3.250.0080.01016.47
7.3.240.0130.01016.39
7.3.230.0060.01316.42
7.3.210.0050.01116.46
7.3.200.0140.00319.39
7.3.190.0140.00616.37
7.3.180.0060.01216.37
7.3.170.0090.00616.71
7.3.160.0090.00616.48
7.3.10.0060.00616.79
7.3.00.0040.01116.77
7.2.330.0090.00916.71
7.2.320.0130.00316.68
7.2.310.0130.01016.54
7.2.300.0070.01016.63
7.2.290.0070.01416.47
7.2.130.0000.01216.63
7.2.120.0030.01416.95
7.2.110.0070.00716.76
7.2.100.0000.00916.89
7.2.90.0060.00916.69
7.2.80.0040.01216.86
7.2.70.0140.00016.98
7.2.60.0080.00516.81
7.2.50.0100.00016.94
7.2.40.0130.00016.80
7.2.30.0070.00716.69
7.2.20.0030.01016.69
7.2.10.0090.00316.85
7.2.00.0080.00418.04
7.1.250.0030.01015.61
7.1.200.0090.00615.70
7.1.100.0030.00917.93
7.1.70.0000.01017.13
7.1.60.0070.01719.40
7.1.50.0100.01017.11
7.1.00.0100.07022.57
7.0.200.0080.00316.45
7.0.140.0000.07721.95
7.0.60.0130.07719.83
7.0.50.0030.04017.86
7.0.40.0130.08020.11
7.0.30.0530.07020.27
7.0.20.0300.07320.09
7.0.10.0230.08020.05
7.0.00.0030.05320.29
5.6.280.0070.07021.10
5.6.210.0070.08020.66
5.6.200.0070.08718.23
5.6.190.0100.06720.49
5.6.180.0230.06020.55
5.6.170.0230.04020.44
5.6.160.0070.08320.47
5.6.150.0130.07718.27
5.6.140.0130.07018.15
5.6.130.0030.08318.15
5.6.120.0070.06020.97
5.6.110.0170.06721.01
5.6.100.0070.04721.09
5.6.90.0170.05720.98
5.6.80.0030.08320.38
5.6.70.0400.07320.53
5.5.350.0130.07320.39
5.5.340.0000.07317.98
5.5.330.0070.07020.40
5.5.320.0370.07320.36
5.5.310.0330.04320.30
5.5.300.0070.07317.95
5.5.290.0130.07717.96
5.5.280.0000.04320.73
5.5.270.0070.07720.65
5.5.260.0030.08020.64
5.5.250.0170.07720.50
5.5.240.0030.08020.26
5.4.450.0700.06319.17
5.4.440.0830.05019.36
5.4.430.0100.05719.55
5.4.420.0170.05319.54
5.4.410.0200.04719.10
5.4.400.0070.05719.32
5.4.390.0230.04718.99
5.4.380.0100.05718.70
5.4.370.0130.04318.54
5.4.360.0100.04318.74
5.4.350.0050.04712.02
5.4.340.0080.04912.02
5.4.320.0070.03812.51
5.4.310.0050.03812.50
5.4.300.0050.03612.50
5.4.290.0060.03612.50
5.4.280.0050.03812.39
5.4.270.0110.03412.40
5.4.260.0060.03712.39
5.4.250.0030.04112.39
5.4.240.0070.04012.39
5.4.230.0070.03712.39
5.4.220.0040.03812.39
5.4.210.0080.03212.39
5.4.200.0070.03912.39
5.4.190.0090.03112.39
5.4.180.0060.03412.39
5.4.170.0060.03512.39
5.4.160.0020.03912.39
5.4.150.0080.03312.39
5.4.140.0070.03412.07
5.4.130.0080.03212.05
5.4.120.0040.03612.02
5.4.110.0070.03812.01
5.4.100.0050.03812.01
5.4.90.0080.03312.02
5.4.80.0060.03512.01
5.4.70.0090.03812.01
5.4.60.0110.03412.01
5.4.50.0030.03612.01
5.4.40.0060.03512.00
5.4.30.0040.03812.00
5.4.20.0060.03411.99
5.4.10.0040.03411.99
5.4.00.0040.03711.48
5.3.290.0050.03912.80
5.3.280.0050.03712.70
5.3.270.0060.03812.72
5.3.260.0080.03612.72
5.3.250.0030.03912.72
5.3.240.0020.04012.72
5.3.230.0090.03412.71
5.3.220.0010.04112.68
5.3.210.0100.03412.68
5.3.200.0070.03412.68
5.3.190.0060.04412.68
5.3.180.0090.03612.67
5.3.170.0070.03412.67
5.3.160.0090.03712.67
5.3.150.0070.03512.67
5.3.140.0080.03212.66
5.3.130.0080.03612.66
5.3.120.0050.03912.66
5.3.110.0050.03812.66
5.3.100.0060.03712.12
5.3.90.0070.03612.09
5.3.80.0050.04212.09
5.3.70.0040.03612.09
5.3.60.0050.03712.07
5.3.50.0040.03712.02
5.3.40.0110.03512.03
5.3.30.0070.03611.98
5.3.20.0060.03611.77
5.3.10.0040.03911.73
5.3.00.0080.03611.71
5.2.170.0050.0309.22
5.2.160.0070.0279.21
5.2.150.0050.0309.21
5.2.140.0040.0319.21
5.2.130.0060.0289.18
5.2.120.0060.0279.17
5.2.110.0030.0309.18
5.2.100.0070.0339.18
5.2.90.0040.0299.18
5.2.80.0030.0309.17
5.2.70.0060.0289.17
5.2.60.0050.0299.13
5.2.50.0030.0319.10
5.2.40.0040.0299.07
5.2.30.0050.0299.05
5.2.20.0050.0279.04
5.2.10.0050.0278.94
5.2.00.0020.0318.80
5.1.60.0060.0258.09
5.1.50.0040.0308.08
5.1.40.0070.0218.06
5.1.30.0040.0258.41
5.1.20.0040.0298.43
5.1.10.0020.0288.16
5.1.00.0050.0308.16
5.0.50.0030.0226.64
5.0.40.0020.0206.50
5.0.30.0030.0356.31
5.0.20.0040.0186.28
5.0.10.0020.0216.25
5.0.00.0050.0356.25
4.4.90.0040.0134.78
4.4.80.0020.0154.75
4.4.70.0030.0144.75
4.4.60.0020.0154.75
4.4.50.0050.0134.77
4.4.40.0060.0224.71
4.4.30.0050.0214.76
4.4.20.0010.0174.84
4.4.10.0040.0154.85
4.4.00.0010.0264.75
4.3.110.0020.0164.66
4.3.100.0060.0114.66
4.3.90.0040.0134.63
4.3.80.0020.0244.58
4.3.70.0020.0144.63
4.3.60.0030.0144.63
4.3.50.0040.0144.63
4.3.40.0020.0244.53
4.3.30.0010.0193.30
4.3.20.0030.0213.28
4.3.10.0010.0173.24
4.3.00.0100.0237.59

preferences:
39.68 ms | 401 KiB | 5 Q