3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = ' one! two: three; '; print_r(str_word_count($str, 1)); print_r(preg_split("/\s+/",trim($str))); print_r(array_filter(explode(' ', implode(' ', array_map('trim', explode("\n", $str))))));

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.0120.00616.63
8.3.50.0260.00322.93
8.3.40.0130.00318.79
8.3.30.0100.00318.95
8.3.20.0070.00420.16
8.3.10.0050.00321.70
8.3.00.0120.00317.63
8.2.180.0120.00916.50
8.2.170.0090.00622.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.0110.00721.04
8.2.110.0040.00422.20
8.2.100.0060.00617.97
8.2.90.0000.00719.13
8.2.80.0060.00317.97
8.2.70.0060.00617.73
8.2.60.0000.00717.93
8.2.50.0040.00418.07
8.2.40.0000.00818.09
8.2.30.0000.00717.92
8.2.20.0050.00317.84
8.2.10.0070.00018.11
8.2.00.0000.00717.80
8.1.280.0070.00725.92
8.1.270.0090.00623.72
8.1.260.0140.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.92
8.1.230.0110.00019.16
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0030.00617.47
8.1.190.0030.00617.48
8.1.180.0060.00318.10
8.1.170.0030.00718.48
8.1.160.0040.00421.93
8.1.150.0040.00418.86
8.1.140.0000.00717.39
8.1.130.0000.00717.77
8.1.120.0040.00417.57
8.1.110.0090.00017.59
8.1.100.0000.00717.62
8.1.90.0040.00417.59
8.1.80.0000.00717.51
8.1.70.0020.00517.48
8.1.60.0030.00517.61
8.1.50.0000.00817.61
8.1.40.0050.00317.54
8.1.30.0000.00817.69
8.1.20.0040.00417.69
8.1.10.0060.00317.55
8.1.00.0090.00017.39
8.0.300.0000.00718.77
8.0.290.0000.00816.75
8.0.280.0030.00318.29
8.0.270.0000.00717.29
8.0.260.0000.00617.20
8.0.250.0000.00716.99
8.0.240.0040.00416.94
8.0.230.0050.00317.06
8.0.220.0030.00316.98
8.0.210.0030.00316.94
8.0.200.0060.00017.05
8.0.190.0040.00417.04
8.0.180.0050.00216.90
8.0.170.0080.00017.01
8.0.160.0030.00516.83
8.0.150.0070.00316.81
8.0.140.0040.00517.01
8.0.130.0030.00313.47
8.0.120.0030.00516.96
8.0.110.0050.00217.00
8.0.100.0040.00417.03
8.0.90.0000.00817.05
8.0.80.0100.00716.86
8.0.70.0020.00516.88
8.0.60.0000.00816.89
8.0.50.0050.00316.86
8.0.30.0100.00917.13
8.0.20.0090.01217.42
8.0.10.0000.00717.09
8.0.00.0070.01216.72
7.4.330.0060.00015.00
7.4.320.0000.00616.68
7.4.300.0030.00316.76
7.4.290.0030.00316.78
7.4.280.0000.00816.66
7.4.270.0000.00816.72
7.4.260.0000.00716.66
7.4.250.0000.00816.55
7.4.240.0020.00516.66
7.4.230.0070.00016.75
7.4.220.0060.01216.71
7.4.210.0040.01116.79
7.4.200.0000.00716.74
7.4.160.0030.01316.46
7.4.150.0040.01417.40
7.4.140.0070.01017.86
7.4.130.0110.00616.71
7.4.120.0050.01216.66
7.4.110.0030.01316.64
7.4.100.0100.00716.55
7.4.90.0130.00316.74
7.4.80.0160.00319.39
7.4.70.0040.01516.76
7.4.60.0070.01016.59
7.4.50.0000.00816.49
7.4.40.0050.01116.61
7.4.30.0060.01516.50
7.4.00.0070.00315.04
7.3.330.0030.00313.17
7.3.320.0000.00613.14
7.3.310.0000.00716.40
7.3.300.0080.00016.32
7.3.290.0030.01016.29
7.3.280.0070.01016.32
7.3.270.0160.00717.40
7.3.260.0090.00916.34
7.3.250.0080.00816.44
7.3.240.0040.01516.33
7.3.230.0120.00616.39
7.3.210.0200.00316.27
7.3.200.0130.01019.39
7.3.190.0150.00616.34
7.3.180.0080.00816.31
7.3.170.0080.00816.43
7.3.160.0110.00616.31
7.2.330.0120.00816.64
7.2.320.0120.00616.54
7.2.310.0130.00616.64
7.2.300.0160.00016.54
7.2.290.0070.01016.74
7.1.70.0000.01117.37
7.1.60.0100.01319.40
7.1.50.0100.01016.74
7.1.00.0030.07722.45
7.0.200.0040.00416.53
7.0.140.0030.07322.11
7.0.60.0030.09020.02
7.0.50.0030.08317.85
7.0.40.0100.06720.26
7.0.30.0530.06320.14
7.0.20.0400.07720.12
7.0.10.0270.06720.03
7.0.00.0030.04020.20
5.6.280.0000.07721.04
5.6.210.0100.07720.69
5.6.200.0030.08318.14
5.6.190.0070.05720.49
5.6.180.3200.04320.47
5.6.170.0230.05720.48
5.6.160.0170.07320.55
5.6.150.0070.08318.11
5.6.140.0070.08318.11
5.6.130.0130.04718.17
5.6.120.0130.07321.05
5.6.110.0030.04321.02
5.6.100.0100.08020.93
5.6.90.0130.08320.96
5.6.80.0100.06720.37
5.6.70.0300.05720.35
5.5.350.0130.03720.40
5.5.340.0100.08018.01
5.5.330.0100.06720.27
5.5.320.0270.05720.32
5.5.310.0230.04020.22
5.5.300.0000.06017.91
5.5.290.0070.07317.97
5.5.280.0170.07720.79
5.5.270.0070.07020.68
5.5.260.0130.07320.83
5.5.250.0030.08320.57
5.5.240.1270.05720.26
5.4.450.0700.06019.55
5.4.440.0830.05019.34
5.4.430.0300.04719.31
5.4.420.0530.05319.48
5.4.410.0070.05719.48
5.4.400.0600.05019.29
5.4.390.0700.05019.11
5.4.380.0130.05718.61
5.4.370.0070.05018.75
5.4.360.0200.03318.46
5.4.350.0050.04512.00
5.4.340.0050.04412.00
5.4.320.0060.04412.48
5.4.310.0100.03512.48
5.4.300.0090.03412.48
5.4.290.0060.04212.48
5.4.280.0060.03712.38
5.4.270.0040.03912.38
5.4.260.0100.03512.38
5.4.250.0040.04112.38
5.4.240.0070.05212.38
5.4.230.0090.04812.37
5.4.220.0090.03712.37
5.4.210.0070.03712.37
5.4.200.0060.04112.37
5.4.190.0040.04012.37
5.4.180.0080.03712.37
5.4.170.0130.04112.38
5.4.160.0150.05412.38
5.4.150.0080.04912.37
5.4.140.0170.04212.05
5.4.130.0110.04812.04
5.4.120.0120.05212.00
5.4.110.0070.03811.99
5.4.100.0060.04612.00
5.4.90.0060.04012.00
5.4.80.0030.04312.00
5.4.70.0130.04511.99
5.4.60.0120.04111.99
5.4.50.0090.03411.99
5.4.40.0060.03711.98
5.4.30.0050.03911.98
5.4.20.0080.03611.98
5.4.10.0050.03811.98
5.4.00.0060.03611.47
5.3.290.0060.04112.80
5.3.280.0090.03512.71
5.3.270.0060.04012.72
5.3.260.0070.04412.72
5.3.250.0080.04012.72
5.3.240.0070.04012.72
5.3.230.0090.03712.71
5.3.220.0110.03412.68
5.3.210.0070.05212.68
5.3.200.0030.04012.68
5.3.190.0100.04812.68
5.3.180.0080.04412.67
5.3.170.0100.04512.67
5.3.160.0110.05312.67
5.3.150.0060.04312.68
5.3.140.0080.04512.66
5.3.130.0090.04312.66
5.3.120.0070.04112.66
5.3.110.0080.04812.65
5.3.100.0100.03512.12
5.3.90.0090.03912.09
5.3.80.0040.04012.08
5.3.70.0080.04212.08
5.3.60.0080.03812.06
5.3.50.0080.03612.01
5.3.40.0080.03512.01
5.3.30.0090.03311.97
5.3.20.0100.04411.75
5.3.10.0090.04911.71
5.3.00.0090.05211.70
5.2.170.0120.0369.21
5.2.160.0060.0429.20
5.2.150.0050.0419.21
5.2.140.0050.0319.20
5.2.130.0070.0279.16
5.2.120.0050.0299.16
5.2.110.0090.0379.17
5.2.100.0060.0319.16
5.2.90.0070.0289.16
5.2.80.0030.0329.16
5.2.70.0050.0319.16
5.2.60.0080.0319.11
5.2.50.0030.0419.08
5.2.40.0040.0309.07
5.2.30.0050.0319.04
5.2.20.0080.0259.04
5.2.10.0030.0318.94
5.2.00.0080.0268.79
5.1.60.0030.0258.07
5.1.50.0050.0248.06
5.1.40.0040.0258.04
5.1.30.0050.0318.39
5.1.20.0040.0278.41
5.1.10.0060.0248.14
5.1.00.0050.0268.14
5.0.50.0040.0206.62
5.0.40.0030.0206.48
5.0.30.0070.0286.29
5.0.20.0060.0176.26
5.0.10.0030.0216.24
5.0.00.0030.0316.23
4.4.90.0030.0154.78
4.4.80.0030.0164.75
4.4.70.0030.0164.75
4.4.60.0030.0174.76
4.4.50.0020.0174.77
4.4.40.0030.0254.71
4.4.30.0060.0124.76
4.4.20.0040.0144.84
4.4.10.0020.0174.85
4.4.00.0040.0244.76
4.3.110.0030.0154.66
4.3.100.0000.0184.67
4.3.90.0040.0184.63
4.3.80.0040.0284.58
4.3.70.0030.0154.63
4.3.60.0040.0154.63
4.3.50.0020.0194.63
4.3.40.0030.0254.53
4.3.30.0020.0173.28
4.3.20.0030.0213.26
4.3.10.0030.0153.22
4.3.00.0100.0237.13

preferences:
40.21 ms | 401 KiB | 5 Q