3v4l.org

run code in 300+ PHP versions simultaneously
<?php function testWordCount ($in) { $is_match = preg_match('/^(\b[^\s]+\s*){2,10}$/', $in); return (boolean)$is_match; } echo "3 words returns:\r\n" var_dump(testWordCount('This is three')) echo "\r\n"; echo "40 words returns:\r\n" var_dump(testWordCount('1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40')) echo "\r\n"; echo "40 words returns:\r\n" var_dump(testWordCount('1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41')) echo "\r\n";

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.270.0100.05318.85
5.4.260.0200.07018.83
5.4.250.0130.05719.13
5.4.240.0100.06019.13
5.4.230.0130.05318.94
5.4.220.0130.06318.91
5.4.210.0230.04319.23
5.4.200.0100.05719.02
5.4.190.0200.04319.06
5.4.180.0100.05318.85
5.4.170.0130.05019.06
5.4.160.0030.06019.07
5.4.150.0130.05319.13
5.4.140.0100.05016.58
5.4.130.0270.05016.37
5.4.120.0170.07016.36
5.4.110.0100.05716.42
5.4.100.0070.05316.66
5.4.90.0130.05016.43
5.4.80.0200.04716.51
5.4.70.0200.06016.61
5.4.60.0100.06316.64
5.4.50.0030.05016.61
5.4.40.0030.05716.51
5.4.30.0070.07016.39
5.4.20.0100.05316.49
5.4.10.0230.04716.60
5.4.00.0130.06016.04
5.3.280.0070.06014.77
5.3.270.0130.08314.80
5.3.260.0170.04314.60
5.3.250.0200.04314.82
5.3.240.0070.07714.89
5.3.230.0100.05014.87
5.3.220.0170.04014.88
5.3.210.0070.05714.68
5.3.200.0100.06314.84
5.3.190.0170.06714.63
5.3.180.0070.05714.73
5.3.170.0130.05014.83
5.3.160.0170.05314.79
5.3.150.0130.06714.82
5.3.140.0100.05314.73
5.3.130.0130.05014.85
5.3.120.0130.05014.84
5.3.110.0170.05014.83
5.3.100.0070.05314.21
5.3.90.0170.06014.31
5.3.80.0000.06714.23
5.3.70.0230.06714.30
5.3.60.0100.06314.30
5.3.50.0000.05714.14
5.3.40.0130.05014.12
5.3.30.0130.05714.10
5.3.20.0100.04713.91
5.3.10.0030.07013.83
5.3.00.0070.05013.70
5.2.170.0000.05311.31
5.2.160.0100.04011.13
5.2.150.0070.04711.13
5.2.140.0100.05011.13
5.2.130.0100.04011.30
5.2.120.0100.05311.27
5.2.110.0130.04011.16
5.2.100.0130.05311.36
5.2.90.0100.04311.38
5.2.80.0100.04011.20
5.2.70.0130.03311.39
5.2.60.0100.06711.36
5.2.50.0070.04711.29
5.2.40.0070.04311.27
5.2.30.0070.04011.25
5.2.20.0100.03310.96
5.2.10.0130.04711.14
5.2.00.0130.03310.89
5.1.60.0100.02710.29
5.1.50.0070.03310.28
5.1.40.0000.03710.02
5.1.30.0000.04010.33
5.1.20.0170.02310.52
5.1.10.0030.0379.95
5.1.00.0100.03010.33
5.0.50.0030.0378.63
5.0.40.0030.0378.68
5.0.30.0030.0408.54
5.0.20.0070.0308.40
5.0.10.0030.0408.27
5.0.00.0130.0438.26
4.4.90.0100.0137.78
4.4.80.0000.0237.78
4.4.70.0000.0337.78
4.4.60.0070.0177.78
4.4.50.0030.0207.78
4.4.40.0030.0337.78
4.4.30.0000.0237.78
4.4.20.0100.0137.78
4.4.10.0000.0377.78
4.4.00.0100.0277.78
4.3.110.0030.0237.78
4.3.100.0030.0207.78
4.3.90.0100.0277.78
4.3.80.0000.0477.78
4.3.70.0000.0337.78
4.3.60.0030.0207.78
4.3.50.0030.0207.78
4.3.40.0000.0377.78
4.3.30.0030.0277.78
4.3.20.0000.0277.78
4.3.10.0030.0237.78
4.3.00.0070.0204.44

preferences:
144.21 ms | 1394 KiB | 7 Q