3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "this is my my word with new word"; //echo count(str_word_count($string)); echo unique_word_count($string); function unique_word_count($string) { $string = explode(' ', strtolower($string)); //$string = str_word_count($string, 1); //$string = preg_split("/[\s,]+/", strtolower($string)); $words = array_unique($string); return count($words); }

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.0110.01118.18
8.3.60.0070.01118.31
8.3.50.0130.00821.93
8.3.40.0040.01118.75
8.3.30.0100.00719.14
8.3.20.0060.00320.20
8.3.10.0030.00523.41
8.3.00.0040.00418.82
8.2.180.0070.01516.38
8.2.170.0040.01122.96
8.2.160.0070.00720.46
8.2.150.0050.00224.18
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0040.00420.72
8.2.110.0090.00019.29
8.2.100.0120.00017.91
8.2.90.0030.00519.22
8.2.80.0080.00017.97
8.2.70.0000.00817.63
8.2.60.0030.00518.03
8.2.50.0050.00318.10
8.2.40.0040.00422.32
8.2.30.0070.00018.30
8.2.20.0000.00717.60
8.2.10.0050.00318.12
8.2.00.0050.00317.77
8.1.280.0070.00725.92
8.1.270.0040.00423.70
8.1.260.0050.00326.35
8.1.250.0000.01428.09
8.1.240.0140.00322.08
8.1.230.0040.00720.94
8.1.220.0040.00417.79
8.1.210.0050.00318.77
8.1.200.0060.00317.38
8.1.190.0080.00017.22
8.1.180.0050.00318.10
8.1.170.0030.00618.65
8.1.160.0040.00421.96
8.1.150.0070.00018.54
8.1.140.0000.00817.39
8.1.130.0030.00317.41
8.1.120.0000.00717.46
8.1.110.0000.00817.46
8.1.100.0040.00417.34
8.1.90.0090.00017.42
8.1.80.0000.00817.49
8.1.70.0030.00317.45
8.1.60.0030.00717.58
8.1.50.0040.00417.39
8.1.40.0040.00417.50
8.1.30.0030.00617.61
8.1.20.0020.00517.55
8.1.10.0050.00317.40
8.1.00.0030.00517.35
8.0.300.0040.00418.77
8.0.290.0040.00416.58
8.0.280.0030.00318.34
8.0.270.0030.00317.16
8.0.260.0080.00016.73
8.0.250.0060.00016.92
8.0.240.0030.00317.01
8.0.230.0070.00016.84
8.0.220.0030.00316.68
8.0.210.0000.00816.82
8.0.200.0000.00616.92
8.0.190.0090.00016.88
8.0.180.0000.00716.75
8.0.170.0030.00516.81
8.0.160.0000.00716.80
8.0.150.0000.00716.68
8.0.140.0080.00016.88
8.0.130.0030.00313.41
8.0.120.0050.00316.77
8.0.110.0070.00016.76
8.0.100.0070.00016.85
8.0.90.0000.00716.95
8.0.80.0070.01116.84
8.0.70.0040.00416.86
8.0.60.0080.00016.91
8.0.50.0000.00816.72
8.0.30.0070.01116.95
8.0.20.0130.01017.40
8.0.10.0040.00416.91
8.0.00.0080.00916.79
7.4.330.0000.00515.00
7.4.320.0030.00316.47
7.4.300.0030.00316.59
7.4.290.0030.00316.60
7.4.280.0040.00416.38
7.4.270.0030.00516.59
7.4.260.0090.00016.46
7.4.250.0000.00816.55
7.4.240.0040.00316.53
7.4.230.0030.00316.43
7.4.220.0030.01516.56
7.4.210.0120.00916.46
7.4.200.0000.00716.62
7.4.190.0030.00316.70
7.4.160.0080.00816.31
7.4.150.0140.00317.40
7.4.140.0090.00817.86
7.4.130.0080.01016.32
7.4.120.0060.01116.44
7.4.110.0120.00916.56
7.4.100.0080.00816.50
7.4.90.0160.00016.55
7.4.80.0060.01619.39
7.4.70.0060.00916.38
7.4.60.0110.00616.50
7.4.50.0040.00416.31
7.4.40.0070.01316.44
7.4.30.0060.01316.43
7.4.00.0100.00314.94
7.3.330.0030.00413.13
7.3.320.0080.00013.22
7.3.310.0030.00316.28
7.3.300.0070.00016.16
7.3.290.0140.00016.29
7.3.280.0100.00816.28
7.3.270.0130.00317.40
7.3.260.0090.00916.39
7.3.250.0100.00716.33
7.3.240.0070.01716.50
7.3.230.0040.01316.39
7.3.210.0030.01516.28
7.3.200.0090.00919.39
7.3.190.0060.01316.48
7.3.180.0040.01116.42
7.3.170.0030.01216.38
7.3.160.0150.00316.27
7.3.120.0060.01015.04
7.3.110.0070.00714.66
7.3.100.0080.00814.82
7.3.90.0100.00614.77
7.3.80.0000.01314.68
7.3.70.0030.01014.83
7.3.60.0070.00714.96
7.3.50.0040.01114.49
7.3.40.0060.00314.61
7.3.30.0030.00714.82
7.3.20.0080.00416.52
7.3.10.0000.01216.15
7.3.00.0030.01016.30
7.2.330.0000.01716.64
7.2.320.0060.01616.74
7.2.310.0100.01316.79
7.2.300.0120.01016.67
7.2.290.0060.01316.46
7.2.250.0100.01014.96
7.2.240.0130.00614.84
7.2.230.0080.01115.02
7.2.220.0030.01014.55
7.2.210.0090.00615.02
7.2.200.0030.01215.14
7.2.190.0070.01015.08
7.2.180.0070.00714.66
7.2.170.0030.00814.99
7.2.00.0060.00819.46
7.1.330.0000.01415.77
7.1.320.0090.00315.73
7.1.310.0030.00615.59
7.1.300.0040.01115.63
7.1.290.0070.00315.74
7.1.280.0030.01415.80
7.1.270.0070.00715.71
7.1.260.0030.01215.70
7.1.100.0060.00617.86
7.1.70.0000.00717.13
7.1.60.0030.02119.70
7.1.50.0000.02216.62
7.1.00.0100.06322.54
7.0.200.0070.00416.82
7.0.140.0000.07322.12
7.0.60.0170.03319.86
7.0.50.0030.04317.88
7.0.40.0030.05320.16
7.0.30.0270.06720.13
7.0.20.0270.08020.26
7.0.10.0230.05320.33
7.0.00.0170.07720.14
5.6.280.0030.07321.07
5.6.210.0030.08720.67
5.6.200.0100.08318.16
5.6.190.0000.09320.42
5.6.180.0000.06020.49
5.6.170.0400.05720.58
5.6.160.0100.05020.55
5.6.150.0070.08318.27
5.6.140.0100.06718.27
5.6.130.0130.08018.17
5.6.120.0070.07021.02
5.6.110.0030.08320.98
5.6.100.0130.08321.14
5.6.90.0200.07721.02
5.6.80.0030.08320.51
5.6.70.4530.03720.40
5.5.350.0000.08720.43
5.5.340.0030.05017.99
5.5.330.0130.06320.14
5.5.320.0300.05720.25
5.5.310.0370.07720.30
5.5.300.0130.04317.98
5.5.290.0030.04317.95
5.5.280.0070.03720.68
5.5.270.0000.04320.98
5.5.260.0100.04720.73
5.5.250.0130.07320.55
5.5.240.0070.05020.13
5.4.450.0230.04319.43
5.4.440.0230.06019.41
5.4.430.0300.06719.54
5.4.420.0270.07019.53
5.4.410.0230.05019.44
5.4.400.0130.04319.21
5.4.390.0230.07019.09
5.4.380.0230.04019.22
5.4.370.0200.05719.20
5.4.360.0230.04718.95
5.4.350.0230.05318.80
5.4.340.0300.04319.14
5.4.320.0230.03319.23
5.4.310.0300.05719.19
5.4.300.0200.03719.08
5.4.290.0230.07718.86
5.4.280.0270.03718.91
5.4.270.0270.06719.14
5.4.260.0300.03319.08
5.4.250.0230.07719.19
5.4.240.0300.03319.16
5.4.230.0200.05719.19
5.4.220.0200.04319.23
5.4.210.0230.06718.98
5.4.200.0230.04718.99
5.4.190.0200.05019.21
5.4.180.0230.03719.21
5.4.170.0200.04319.22
5.4.160.0270.07319.07
5.4.150.0300.07019.21
5.4.140.0200.05716.34
5.4.130.0300.06316.47
5.4.120.0230.06316.34
5.4.110.0270.04316.51
5.4.100.0300.03016.33
5.4.90.0200.06316.30
5.4.80.0200.04316.44
5.4.70.0270.06716.17
5.4.60.0330.04716.43
5.4.50.0300.06316.43
5.4.40.0200.04016.55
5.4.30.0200.06716.53
5.4.20.0200.05016.25
5.4.10.0200.07016.43
5.4.00.0230.04015.79
5.3.290.0330.06314.56
5.3.280.0230.04014.51
5.3.270.0230.07014.72
5.3.260.0270.05314.52
5.3.250.0170.07314.51
5.3.240.0300.06014.58
5.3.230.0270.07714.58
5.3.220.0200.06714.57
5.3.210.0270.07314.69
5.3.200.0300.07014.56
5.3.190.0270.06714.73
5.3.180.0300.06714.48
5.3.170.0300.06314.71
5.3.160.0200.05714.55
5.3.150.0230.07314.78
5.3.140.0300.06714.77
5.3.130.0270.05014.45
5.3.120.0170.05014.53
5.3.110.0200.07014.55
5.3.100.0400.06013.95
5.3.90.0300.04014.02
5.3.80.0200.03714.16
5.3.70.0230.07314.16
5.3.60.0300.06714.09
5.3.50.0300.06314.04
5.3.40.0270.07014.03
5.3.30.0200.04013.99
5.3.20.0200.05013.77
5.3.10.0270.07313.58
5.3.00.0270.06013.73
5.2.170.0230.04012.46
5.2.160.0200.04312.46
5.2.150.0230.05712.46
5.2.140.0230.05312.46
5.2.130.0300.04312.46
5.2.120.0200.05312.46
5.2.110.0230.03312.46
5.2.100.0230.05712.46
5.2.90.0270.04712.46
5.2.80.0130.04312.46
5.2.70.0170.03712.46
5.2.60.0230.05012.46
5.2.50.0130.03312.46
5.2.40.0170.02712.46
5.2.30.0200.05712.46
5.2.20.0230.05712.46
5.2.10.0230.05012.46
5.2.00.0230.05012.46
5.1.60.0230.04012.46
5.1.50.0170.05012.46
5.1.40.0200.03712.46
5.1.30.0230.05012.46
5.1.20.0200.03712.46
5.1.10.0100.03012.46
5.1.00.0200.03712.46
5.0.50.0100.02712.46
5.0.40.0130.03712.46
5.0.30.0100.03012.46
5.0.20.0070.03012.46
5.0.10.0100.02312.46
5.0.00.0030.03312.46
4.4.90.0070.01712.46
4.4.80.0100.01312.46
4.4.70.0130.03012.46
4.4.60.0030.01712.46
4.4.50.0070.03012.46
4.4.40.0070.02312.46
4.4.30.0070.02712.46
4.4.20.0030.01712.46
4.4.10.0070.01712.46
4.4.00.0070.02712.46
4.3.110.0070.03712.46
4.3.100.0030.01712.46
4.3.90.0100.02012.46
4.3.80.0030.03312.46
4.3.70.0100.01312.46
4.3.60.0030.02712.46
4.3.50.0100.03012.46
4.3.40.0070.02712.46
4.3.30.0030.02012.46
4.3.20.0030.02012.46
4.3.10.0030.02012.46
4.3.00.0000.02312.46

preferences:
62.23 ms | 401 KiB | 5 Q