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 ("Three words returns:\r\n".print_r(testWordCount('This is three'), true)."\r\n"); echo ("Fourty words returns:\r\n".print_r(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'), true)."\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)
8.3.70.0030.01218.30
8.3.60.0120.00918.45
8.3.50.0140.00522.05
8.3.40.0120.00918.76
8.3.30.0030.01019.10
8.3.20.0000.00720.16
8.3.10.0090.00622.10
8.3.00.0050.00322.34
8.2.180.0110.00416.63
8.2.170.0070.00722.96
8.2.160.0110.00320.93
8.2.150.0160.00024.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0100.00517.75
8.2.110.0060.00620.52
8.2.100.0040.00717.91
8.2.90.0000.00719.15
8.2.80.0040.00417.97
8.2.70.0030.00517.63
8.2.60.0000.00918.03
8.2.50.0090.00018.07
8.2.40.0000.00818.34
8.2.30.0000.00718.16
8.2.20.0050.00317.77
8.2.10.0040.00417.74
8.2.00.0000.00817.84
8.1.280.0040.01125.92
8.1.270.0100.00722.06
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.87
8.1.230.0060.00619.02
8.1.220.0080.00017.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0090.00017.39
8.1.180.0030.00618.10
8.1.170.0090.00018.77
8.1.160.0000.00722.11
8.1.150.0000.01018.81
8.1.140.0000.00817.50
8.1.130.0000.00717.75
8.1.120.0080.00017.68
8.1.110.0040.00417.66
8.1.100.0040.00417.58
8.1.90.0000.00717.65
8.1.80.0040.00417.64
8.1.70.0000.00717.57
8.1.60.0000.00817.80
8.1.50.0050.00217.72
8.1.40.0000.00817.65
8.1.30.0000.00817.80
8.1.20.0030.00517.83
8.1.10.0030.00617.57
8.1.00.0030.00617.69
8.0.300.0070.00018.77
8.0.290.0000.00717.18
8.0.280.0070.00018.40
8.0.270.0030.00416.98
8.0.260.0000.00616.89
8.0.250.0030.00317.12
8.0.240.0040.00417.07
8.0.230.0030.00317.12
8.0.220.0000.00717.11
8.0.210.0020.00517.08
8.0.200.0000.00617.12
8.0.190.0020.00517.15
8.0.180.0040.00417.10
8.0.170.0000.00817.11
8.0.160.0020.00517.09
8.0.150.0070.00016.97
8.0.140.0030.00416.92
8.0.130.0030.00313.39
8.0.120.0090.00017.01
8.0.110.0040.00417.07
8.0.100.0000.00716.96
8.0.90.0070.00017.13
8.0.80.0030.01617.07
8.0.70.0040.00416.98
8.0.60.0080.00017.01
8.0.50.0040.00416.96
8.0.30.0180.00317.00
8.0.20.0100.01017.46
8.0.10.0000.00717.25
8.0.00.0140.00417.07
7.4.330.0020.00215.05
7.4.320.0030.00316.79
7.4.300.0000.00616.73
7.4.290.0000.00716.64
7.4.280.0080.00016.83
7.4.270.0030.00316.83
7.4.260.0050.00216.77
7.4.250.0000.00716.77
7.4.240.0020.00516.81
7.4.230.0000.00716.73
7.4.220.0080.01116.88
7.4.210.0080.01016.83
7.4.200.0040.00416.48
7.4.190.0070.00016.59
7.4.160.0110.00716.69
7.4.150.0130.00717.40
7.4.140.0090.01317.86
7.4.130.0110.00816.71
7.4.120.0080.01016.66
7.4.110.0110.00616.55
7.4.100.0090.00916.75
7.4.90.0070.01116.45
7.4.80.0090.01219.39
7.4.70.0090.00916.83
7.4.60.0070.01516.69
7.4.50.0090.00016.57
7.4.40.0080.00822.77
7.4.30.0060.00916.81
7.4.00.0030.01215.40
7.3.330.0000.00513.46
7.3.320.0030.00313.40
7.3.310.0000.00816.56
7.3.300.0030.00316.32
7.3.290.0040.00916.53
7.3.280.0090.00616.43
7.3.270.0080.01117.40
7.3.260.0150.00416.58
7.3.250.0110.01116.59
7.3.240.0120.00616.44
7.3.230.0030.01516.58
7.3.210.0090.00916.75
7.3.200.0070.01019.39
7.3.190.0030.01616.68
7.3.180.0060.01016.59
7.3.170.0140.00316.47
7.3.160.0090.01216.64
7.3.120.0100.00714.80
7.2.330.0120.01116.80
7.2.320.0130.00716.75
7.2.310.0120.00416.69
7.2.300.0140.00416.93
7.2.290.0030.01316.93
7.2.120.0060.00616.93
7.2.110.0000.01516.82
7.2.100.0040.01116.68
7.2.90.0030.01216.46
7.2.80.0060.00916.88
7.2.70.0100.00317.14
7.2.60.0000.01417.13
7.2.50.0100.00316.80
7.2.40.0060.00617.04
7.2.30.0030.01016.85
7.2.20.0070.00717.18
7.2.10.0090.00617.09
7.2.00.0030.01116.83
7.1.240.0060.00915.97
7.1.230.0040.00816.06
7.1.220.0070.00315.93
7.1.210.0060.00615.96
7.1.200.0030.01015.71
7.1.190.0030.00615.92
7.1.180.0070.00715.90
7.1.170.0030.01015.74
7.1.160.0030.01215.99
7.1.150.0060.00615.79
7.1.140.0000.01515.93
7.1.130.0040.00915.89
7.1.120.0000.00916.08
7.1.110.0040.00815.98
7.1.100.0000.01116.00
7.1.90.0070.00015.90
7.1.80.0110.00416.03
7.1.70.0080.00516.71
7.1.60.0060.00817.80
7.1.50.0050.00716.47
7.1.40.0060.00315.85
7.1.30.0040.00416.00
7.1.20.0040.00415.85
7.1.10.0070.00716.00
7.1.00.0050.04119.14
7.0.320.0030.00915.36
7.0.310.0060.00615.61
7.0.300.0100.00315.50
7.0.290.0000.00815.57
7.0.280.0040.00815.42
7.0.270.0080.00615.50
7.0.260.0090.00615.68
7.0.250.0060.00315.59
7.0.240.0030.01015.48
7.0.230.0060.00615.63
7.0.220.0110.00315.54
7.0.210.0060.00315.48
7.0.200.0130.00416.27
7.0.190.0080.00415.51
7.0.180.0060.00315.68
7.0.170.0030.01115.68
7.0.160.0060.00615.45
7.0.150.0000.00915.77
7.0.140.0050.03818.85
7.0.130.0060.00915.68
7.0.120.0040.00715.61
7.0.110.0060.04517.82
7.0.100.0090.04217.79
7.0.90.0070.04417.67
7.0.80.0050.02817.70
7.0.70.0030.04617.87
7.0.60.0120.03517.80
7.0.50.0080.04417.86
7.0.40.0100.04216.64
7.0.30.0080.03616.77
7.0.20.0130.03316.80
7.0.10.0080.04316.79
7.0.00.0050.04816.77
5.6.380.0000.01014.54
5.6.370.0000.01414.44
5.6.360.0100.00314.55
5.6.350.0080.00614.61
5.6.340.0070.00714.24
5.6.330.0100.00314.52
5.6.320.0040.01114.57
5.6.310.0130.00014.80
5.6.300.0080.00314.25
5.6.290.0050.00314.67
5.6.280.0090.03717.67
5.6.270.0030.01014.34
5.6.260.0080.03817.38
5.6.250.0080.04017.47
5.6.240.0090.04217.51
5.6.230.0100.02517.63
5.6.220.0050.02917.50
5.6.210.0050.03717.63
5.6.200.0100.03817.37
5.6.190.0110.03617.40
5.6.180.0050.04317.41
5.6.170.0060.04117.60
5.6.160.0160.03317.67
5.6.150.0120.03517.52
5.6.140.0080.04217.45
5.6.130.0080.04117.51
5.6.120.0170.03717.54
5.6.110.0070.04317.56
5.6.100.0050.04217.61
5.6.90.0100.02517.58
5.6.80.0070.02316.96
5.6.70.0020.04717.00
5.6.60.0110.04117.14
5.6.50.0070.04217.04
5.6.40.0080.03617.07
5.6.30.0050.04517.11
5.6.20.0130.03817.13
5.6.10.0080.04317.09
5.6.00.0060.04017.24
5.5.380.0070.04014.52
5.5.370.0100.03514.54
5.5.360.0070.04114.48
5.5.350.0050.04314.47
5.5.340.0050.04114.56
5.5.330.0020.04414.68
5.5.320.0080.04014.69
5.5.310.0050.04514.69
5.5.300.0060.04314.84
5.5.290.0070.04314.62
5.5.280.0080.04214.66
5.5.270.0030.04514.67
5.5.260.0020.02714.87
5.5.250.0060.03714.49
5.5.240.0060.04014.39
5.5.230.0030.04214.44
5.5.220.0060.04314.28
5.5.210.0090.04014.29
5.5.200.0030.04214.37
5.5.190.0020.04314.37
5.5.180.0080.03514.39
5.5.170.0060.00614.35
5.5.160.0120.03514.28
5.5.150.0100.03714.25
5.5.140.0050.04014.34
5.5.130.0060.03214.23
5.5.120.0080.03814.51
5.5.110.0060.04214.36
5.5.100.0090.04014.31
5.5.90.0080.03714.22
5.5.80.0020.04314.23
5.5.70.0030.04214.22
5.5.60.0080.03714.39
5.5.50.0080.04014.29
5.5.40.0050.04414.24
5.5.30.0010.03814.21
5.5.20.0030.04514.33
5.5.10.0050.04214.37
5.5.00.0020.04014.31
5.4.450.0030.04815.39
5.4.440.0070.04315.31
5.4.430.0030.03115.46
5.4.420.0050.02315.31
5.4.410.0020.04315.21
5.4.400.0060.02215.22
5.4.390.0050.04115.15
5.4.380.0090.03515.23
5.4.370.0050.03615.31
5.4.360.0060.04315.15
5.4.350.0050.02815.19
5.4.340.0110.03315.29
5.4.330.0000.01111.27
5.4.320.0050.04315.16
5.4.310.0080.03715.14
5.4.300.0110.03815.14
5.4.290.0030.03015.19
5.4.280.0030.04515.25
5.4.270.0090.04015.22
5.4.260.0100.03515.26
5.4.250.0050.04315.13
5.4.240.0050.04115.11
5.4.230.0040.03715.11
5.4.220.0080.03515.13
5.4.210.0080.03815.14
5.4.200.0070.03815.26
5.4.190.0030.03915.29
5.4.180.0070.03415.13
5.4.170.0110.03615.15
5.4.160.0110.03815.30
5.4.150.0100.03415.18
5.4.140.0060.02613.92
5.4.130.0060.02013.91
5.4.120.0060.02013.84
5.4.110.0120.03413.96
5.4.100.0050.03713.99
5.4.90.0050.02813.95
5.4.80.0080.03213.87
5.4.70.0060.03313.85
5.4.60.0090.03813.88
5.4.50.0020.04113.83
5.4.40.0080.03913.93
5.4.30.0070.03213.80
5.4.20.0050.04013.88
5.4.10.0070.04113.92
5.4.00.0080.03813.53
5.3.290.0020.04212.97
5.3.280.0060.04312.93
5.3.270.0100.03712.94
5.3.260.0090.04013.01
5.3.250.0030.04112.98
5.3.240.0050.03712.95
5.3.230.0070.03513.00
5.3.220.0050.04013.04
5.3.210.0080.03612.99
5.3.200.0080.03512.93
5.3.190.0120.03512.97
5.3.180.0030.04013.04
5.3.170.0030.03012.97
5.3.160.0050.04112.93
5.3.150.0110.03613.04
5.3.140.0050.03912.97
5.3.130.0070.04012.92
5.3.120.0110.03712.92
5.3.110.0070.03212.92
5.3.100.0060.03812.64
5.3.90.0060.03812.72
5.3.80.0020.03012.63
5.3.70.0030.03812.65
5.3.60.0070.03512.66
5.3.50.0090.03312.61
5.3.40.0070.03512.54
5.3.30.0030.03912.71
5.3.20.0030.04212.53
5.3.10.0050.03512.58
5.3.00.0050.04012.49
5.2.170.0030.03311.29
5.2.160.0050.03311.29
5.2.150.0040.03111.29
5.2.140.0020.03711.29
5.2.130.0090.02811.30
5.2.120.0000.02611.29
5.2.110.0030.02611.29
5.2.100.0080.02711.29
5.2.90.0060.03311.29
5.2.80.0100.02711.30
5.2.70.0070.03211.29
5.2.60.0050.03411.29
5.2.50.0080.03011.29
5.2.40.0100.02511.29
5.2.30.0030.03311.29
5.2.20.0100.02811.29
5.2.10.0100.02511.29
5.2.00.0050.02311.29
5.1.60.0060.02711.29
5.1.50.0020.02711.29
5.1.40.0030.02911.29
5.1.30.0060.01911.29
5.1.20.0020.01711.29
5.1.10.0020.01511.29
5.1.00.0060.02811.29
5.0.50.0070.02211.29
5.0.40.0050.02311.29
5.0.30.0090.02511.29
5.0.20.0030.02311.29
5.0.10.0060.02311.29
5.0.00.0050.03211.29
4.4.90.0020.01911.29
4.4.80.0050.01611.29
4.4.70.0020.01011.29
4.4.60.0030.01811.29
4.4.50.0020.01811.29
4.4.40.0020.02511.29
4.4.30.0020.02011.29
4.4.20.0050.00811.29
4.4.10.0020.02011.29
4.4.00.0020.03011.29
4.3.110.0000.02111.29
4.3.100.0020.02011.29
4.3.90.0020.01811.29
4.3.80.0020.02711.29
4.3.70.0020.02011.29
4.3.60.0030.01511.29
4.3.50.0030.02011.29
4.3.40.0030.02711.29
4.3.30.0000.02111.29
4.3.20.0020.02011.29
4.3.10.0000.01611.29
4.3.00.0000.02011.29

preferences:
43.71 ms | 401 KiB | 5 Q