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", $string)))))};

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)
5.4.310.0230.04019.24
5.4.300.0130.04019.31
5.4.290.0200.03319.08
5.4.280.0130.04018.84
5.4.270.0200.03319.22
5.4.260.0230.04018.87
5.4.250.0270.03719.21
5.4.240.0300.06718.83
5.4.230.0300.06019.30
5.4.220.0230.04019.23
5.4.210.0130.04019.14
5.4.200.0230.05019.14
5.4.190.0170.04719.18
5.4.180.0170.03718.98
5.4.170.0230.03319.08
5.4.160.0200.03019.29
5.4.150.0170.04019.29
5.4.140.0300.03716.32
5.4.130.0230.04316.36
5.4.120.0200.03016.66
5.4.110.0170.03316.37
5.4.100.0170.04716.35
5.4.90.0170.03716.25
5.4.80.0170.03316.57
5.4.70.0170.03316.57
5.4.60.0200.05316.33
5.4.50.0230.03016.51
5.4.40.0170.03716.52
5.4.30.0230.03316.51
5.4.20.0170.03316.51
5.4.10.0170.03716.48
5.4.00.0200.05715.96
5.3.290.0170.04314.65
5.3.280.0100.04714.45
5.3.270.0100.04314.46
5.3.260.0100.05714.44
5.3.250.0200.07014.55
5.3.240.0300.06014.55
5.3.230.0270.06014.54
5.3.220.0270.05714.55
5.3.210.0100.04714.52
5.3.200.0170.03714.47
5.3.190.0200.03714.52
5.3.180.0130.04014.47
5.3.170.0270.06714.51
5.3.160.0300.04714.61
5.3.150.0270.04014.47
5.3.140.0230.05014.50
5.3.130.0100.05314.40
5.3.120.0230.06014.50
5.3.110.0170.05714.39
5.3.100.0170.06713.98
5.3.90.0230.06313.97
5.3.80.0230.06313.84
5.3.70.0270.04314.06
5.3.60.0230.06314.02
5.3.50.0230.06013.89
5.3.40.0170.03713.96
5.3.30.0200.07013.89
5.3.20.0170.03313.79
5.3.10.0230.06713.53
5.3.00.0230.06313.57
5.2.170.0230.02711.11
5.2.160.0100.03711.15
5.2.150.0270.02711.16
5.2.140.0200.05710.99
5.2.130.0230.05010.94
5.2.120.0200.05011.15
5.2.110.0200.05311.04
5.2.100.0130.03010.95
5.2.90.0170.03711.01
5.2.80.0300.05711.04
5.2.70.0270.05711.00
5.2.60.0270.05011.09
5.2.50.0300.04710.86
5.2.40.0130.04010.90
5.2.30.0200.05311.01
5.2.20.0170.05310.97
5.2.10.0170.03710.83
5.2.00.0270.04310.68
5.1.60.0170.0239.89
5.1.50.0200.01710.15
5.1.40.0130.03010.06
5.1.30.0200.05310.35
5.1.20.0130.03710.25
5.1.10.0200.0439.99
5.1.00.0200.0279.99
5.0.50.0300.0408.45
5.0.40.0200.0338.27
5.0.30.0170.0308.30
5.0.20.0130.0408.35
5.0.10.0100.0238.06
5.0.00.0130.0638.27
4.4.90.0030.0208.06
4.4.80.0100.0238.06
4.4.70.0100.0338.06
4.4.60.0070.0308.06
4.4.50.0170.0278.06
4.4.40.0100.0408.06
4.4.30.0100.0178.06
4.4.20.0130.0308.06
4.4.10.0100.0238.06
4.4.00.0100.0378.06
4.3.110.0100.0308.06
4.3.100.0100.0238.06
4.3.90.0100.0278.06
4.3.80.0170.0438.06
4.3.70.0130.0278.06
4.3.60.0100.0238.06
4.3.50.0070.0238.06
4.3.40.0100.0278.06
4.3.30.0100.0138.06
4.3.20.0030.0208.06
4.3.10.0030.0238.06
4.3.00.0070.0178.06

preferences:
143.72 ms | 1394 KiB | 7 Q