3v4l.org

run code in 300+ PHP versions simultaneously
<?php function countWords($sentence) { return count(preg_split('/\s+/', $sentence)); } echo countWords("my name is john"); echo countWords("my name \n\r is john"); echo countWords("my name \n is john"); echo countWords("my name \n\n\r is john"); echo countWords("my \n name is john");

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.0140.00718.36
8.3.50.0090.01521.91
8.3.40.0090.00618.80
8.3.30.0110.00418.92
8.3.20.0100.01020.16
8.3.10.0080.00018.73
8.3.00.0050.00320.75
8.2.180.0200.00018.31
8.2.170.0150.00622.96
8.2.160.0030.01019.08
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0040.00419.50
8.2.120.0040.00426.35
8.2.110.0060.00319.24
8.2.100.0040.00817.61
8.2.90.0000.00819.05
8.2.80.0060.00317.97
8.2.70.0080.00017.88
8.2.60.0070.00317.79
8.2.50.0040.00418.10
8.2.40.0030.00620.61
8.2.30.0040.00420.72
8.2.20.0040.00417.84
8.2.10.0070.00018.03
8.2.00.0040.00418.01
8.1.280.0070.01125.92
8.1.270.0040.00423.79
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0070.00321.00
8.1.230.0080.00317.66
8.1.220.0030.00617.74
8.1.210.0090.00018.77
8.1.200.0070.00317.35
8.1.190.0030.00617.23
8.1.180.0050.00318.10
8.1.170.0060.00318.63
8.1.160.0030.00320.84
8.1.150.0040.00418.82
8.1.140.0080.00019.60
8.1.130.0000.00717.63
8.1.120.0040.00417.47
8.1.110.0030.00517.58
8.1.100.0000.00817.44
8.1.90.0000.00817.55
8.1.80.0050.00317.48
8.1.70.0040.00417.46
8.1.60.0040.00417.71
8.1.50.0040.00417.56
8.1.40.0060.00317.57
8.1.30.0050.00317.70
8.1.20.0040.00417.72
8.1.10.0070.00017.56
8.1.00.0040.00417.58
8.0.300.0060.00318.77
8.0.290.0000.00716.63
8.0.280.0000.00718.32
8.0.270.0000.00717.14
8.0.260.0000.00617.09
8.0.250.0080.00017.04
8.0.240.0040.00417.07
8.0.230.0050.00316.85
8.0.220.0030.00516.79
8.0.210.0040.00416.95
8.0.200.0040.00416.98
8.0.190.0000.00717.09
8.0.180.0040.00416.89
8.0.170.0060.00317.04
8.0.160.0040.00417.04
8.0.150.0000.00716.83
8.0.140.0040.00416.91
8.0.130.0030.00313.39
8.0.120.0080.00016.93
8.0.110.0050.00316.96
8.0.100.0040.00417.09
8.0.90.0000.00717.04
8.0.80.0070.01617.03
8.0.70.0000.00816.84
8.0.60.0070.00016.97
8.0.50.0040.00416.85
8.0.30.0140.00717.31
8.0.20.0090.01217.40
8.0.10.0040.00417.04
8.0.00.0090.01116.91
7.4.330.0000.00615.08
7.4.320.0030.00316.56
7.4.300.0070.00016.82
7.4.290.0050.00316.62
7.4.280.0000.00816.74
7.4.270.0040.00416.62
7.4.260.0040.00416.64
7.4.250.0000.00716.63
7.4.240.0040.00416.79
7.4.230.0030.00316.86
7.4.220.0030.01516.73
7.4.210.0080.00816.74
7.4.200.0040.00416.59
7.4.160.0030.01316.88
7.4.150.0100.01017.40
7.4.140.0100.00817.86
7.4.130.0170.00516.76
7.4.120.0050.01316.67
7.4.110.0120.00616.82
7.4.100.0030.01416.62
7.4.90.0130.00316.60
7.4.80.0150.00319.39
7.4.70.0140.00316.73
7.4.60.0100.00716.56
7.4.50.0030.01416.41
7.4.40.0170.00316.69
7.4.30.0060.01016.63
7.4.10.0040.01414.91
7.4.00.0080.00915.16
7.3.330.0030.00313.20
7.3.320.0050.00013.38
7.3.310.0000.00816.43
7.3.300.0000.00716.33
7.3.290.0000.00716.25
7.3.280.0150.00316.37
7.3.270.0130.00317.40
7.3.260.0100.01316.57
7.3.250.0130.00516.61
7.3.240.0070.01216.46
7.3.230.0130.00316.47
7.3.210.0060.01116.44
7.3.200.0080.00816.63
7.3.190.0070.01016.37
7.3.180.0110.00916.69
7.3.170.0100.01516.57
7.3.160.0080.00816.46
7.3.130.0000.01614.61
7.3.120.0040.01114.72
7.3.110.0090.00514.87
7.3.100.0060.00814.78
7.3.90.0030.01214.76
7.3.80.0070.00614.76
7.3.70.0040.00914.80
7.3.60.0090.00514.91
7.3.50.0070.00714.87
7.3.40.0070.00814.81
7.3.30.0030.01214.63
7.3.20.0030.00816.86
7.3.10.0090.00516.65
7.3.00.0050.01016.84
7.2.330.0090.00916.86
7.2.320.0070.01416.65
7.2.310.0090.00916.68
7.2.300.0110.01216.77
7.2.290.0070.01016.82
7.2.260.0060.01215.01
7.2.250.0090.00815.06
7.2.240.0080.00814.88
7.2.230.0050.01014.87
7.2.220.0050.01015.02
7.2.210.0030.01214.90
7.2.200.0020.01215.21
7.2.190.0070.00714.79
7.2.180.0050.01115.03
7.2.170.0030.01215.09
7.2.160.0070.00415.14
7.2.150.0100.00316.99
7.2.140.0060.00916.80
7.2.130.0000.01516.97
7.2.120.0030.00617.02
7.2.110.0000.01017.02
7.2.100.0060.01017.16
7.2.90.0080.01116.78
7.2.80.0040.01116.90
7.2.70.0040.00817.16
7.2.60.0090.00917.04
7.2.50.0040.00817.05
7.2.40.0000.01316.91
7.2.30.0080.00416.87
7.2.20.0070.00716.80
7.2.10.0110.00017.12
7.2.00.0020.01218.22
7.1.330.0060.00715.94
7.1.320.0040.00915.96
7.1.310.0050.01015.79
7.1.300.0040.01215.80
7.1.290.0030.01215.64
7.1.280.0060.01115.72
7.1.270.0080.00415.87
7.1.260.0070.00215.71
7.1.250.0040.01115.75
7.1.240.0030.00515.86
7.1.230.0070.00715.70
7.1.220.0000.00815.76
7.1.210.0060.00915.54
7.1.200.0060.00715.90
7.1.190.0060.01015.64
7.1.180.0040.00415.84
7.1.170.0030.01315.70
7.1.160.0060.00915.48
7.1.150.0070.00715.55
7.1.140.0070.00715.83
7.1.130.0000.00915.97
7.1.120.0030.00715.74
7.1.110.0030.00915.70
7.1.100.0030.01017.06
7.1.90.0070.01015.83
7.1.80.0130.00015.79
7.1.70.0000.01016.33
7.1.60.0050.01517.47
7.1.50.0030.01115.87
7.1.40.0030.01315.89
7.1.30.0080.00615.77
7.1.20.0040.00915.43
7.1.10.0060.00815.65
7.1.00.0060.04119.18
7.0.330.0030.01015.47
7.0.320.0030.01015.30
7.0.310.0030.01015.08
7.0.300.0000.01615.31
7.0.290.0140.00015.05
7.0.280.0070.00715.32
7.0.270.0050.00515.34
7.0.260.0000.01315.52
7.0.250.0060.00915.41
7.0.240.0030.01015.55
7.0.230.0090.00315.52
7.0.220.0060.00314.94
7.0.210.0060.00614.96
7.0.200.0030.00716.15
7.0.190.0060.00615.20
7.0.180.0140.00015.57
7.0.170.0100.00315.71
7.0.160.0070.00315.39
7.0.150.0060.00915.45
7.0.140.0040.01115.41
7.0.130.0000.01015.00
7.0.120.0070.00715.19
7.0.110.0060.00315.43
7.0.100.0140.00015.09
7.0.90.0140.00015.35
7.0.80.0060.00615.05
7.0.70.0120.00015.55
7.0.60.0120.04517.57
7.0.50.0090.02416.72
7.0.40.0070.03916.74
7.0.30.0190.02416.74
7.0.20.0170.03316.78
7.0.10.0140.03516.74
7.0.00.0110.02916.61
5.6.400.0000.01414.13
5.6.390.0000.01014.25
5.6.380.0030.00914.02
5.6.370.0070.01114.03
5.6.360.0060.00614.23
5.6.350.0000.01214.21
5.6.340.0060.00814.01
5.6.330.0130.00014.10
5.6.320.0070.00314.38
5.6.310.0040.01113.73
5.6.300.0040.00414.20
5.6.290.0090.00313.94
5.6.280.0070.03817.54
5.6.270.0070.00714.07
5.6.260.0000.01213.65
5.6.250.0070.00713.90
5.6.240.0090.00614.01
5.6.230.0030.01014.20
5.6.220.0060.01014.35
5.6.210.0110.04117.33
5.6.200.0070.02716.10
5.6.190.0130.03317.43
5.6.180.0140.03217.32
5.6.170.0130.03017.29
5.6.160.0050.03517.24
5.6.150.0110.03417.28
5.6.140.0080.03917.28
5.6.130.0150.03317.46
5.6.120.0090.03717.24
5.6.110.0100.03017.33
5.6.100.0120.03617.18
5.6.90.0340.03317.17
5.6.80.0310.03316.83
5.6.70.0100.03716.80
5.6.60.0140.03116.77
5.6.50.0150.03016.66
5.6.40.0140.02716.85
5.6.30.0080.03616.76
5.6.20.0070.03316.90
5.6.10.0140.02916.86
5.6.00.0130.03616.58
5.5.380.0030.01414.12
5.5.370.0040.00414.14
5.5.360.0130.00014.30
5.5.350.0050.04517.42
5.5.340.0080.01816.09
5.5.330.0180.02817.39
5.5.320.0060.03617.37
5.5.310.0150.02817.28
5.5.300.0110.03817.11
5.5.290.0170.02817.27
5.5.280.0070.03517.12
5.5.270.0130.02817.23
5.5.260.0280.03517.21
5.5.250.0280.02817.04
5.5.240.0300.03016.76
5.5.230.0100.03316.90
5.5.220.0100.03216.91
5.5.210.0050.03617.02
5.5.200.0170.02216.91
5.5.190.0080.03716.74
5.5.180.0180.02516.86
5.5.170.0040.00713.86
5.5.160.0160.02916.79
5.5.150.0140.04216.85
5.5.140.0100.04516.97
5.5.130.0080.04216.91
5.5.120.0080.03416.59
5.5.110.0090.03616.60
5.5.100.0190.02716.81
5.5.90.0090.03416.69
5.5.80.0150.03016.76
5.5.70.0200.03316.67
5.5.60.0130.02616.58
5.5.50.0060.03316.63
5.5.40.0110.02916.59
5.5.30.0130.02716.71
5.5.20.0070.03416.76
5.5.10.0120.03116.74
5.5.00.0100.03316.78

preferences:
32.17 ms | 401 KiB | 5 Q