3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cleanWord( &$word ){ $word = trim($word, "'\".!<>{}()-/\*&^%$#@+~ "); } // list of comments $arr_str = [ " this!! is the first &test message./", "*Second ^message this (is) ", "'another\ **message*** !\"}& it is. also the favorite one (message)." ]; // To join array's items $str = implode(" ", $arr_str); // To chop the string based on the space $words = explode(" ",$str); // To remove redundant character(s) array_walk($words, 'cleanWord'); // To remove empty array elements $words = array_filter($words); print_r($words);

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.5.10.0120.00821.31
8.5.00.0140.00719.94
8.4.160.0100.01222.75
8.4.150.0030.00014.05
8.4.140.0140.00717.40
8.4.130.0120.00717.52
8.4.120.0120.00520.34
8.4.110.0080.01122.47
8.4.100.0130.00817.67
8.4.90.0100.00418.84
8.4.80.0040.00417.53
8.4.70.0120.00817.46
8.4.60.0120.00818.69
8.4.50.0120.00818.51
8.4.40.0070.01119.11
8.4.30.0130.00619.47
8.4.20.0030.01618.31
8.4.10.0060.00319.38
8.3.290.0130.00722.48
8.3.280.0130.00718.49
8.3.270.0110.00816.56
8.3.260.0050.00316.45
8.3.250.0050.00319.01
8.3.240.0110.00916.40
8.3.230.0070.00116.39
8.3.220.0130.00417.07
8.3.210.0100.00618.38
8.3.200.0020.00616.50
8.3.190.0090.00616.99
8.3.180.0110.00816.70
8.3.170.0090.00916.95
8.3.160.0120.00616.56
8.3.150.0040.01418.31
8.3.140.0080.00017.13
8.3.130.0030.00618.46
8.3.120.0060.00918.66
8.3.110.0070.00320.94
8.3.100.0060.00324.06
8.3.90.0060.00326.77
8.3.80.0030.00618.43
8.3.70.0110.00716.50
8.3.60.0110.00418.55
8.3.50.0130.00721.94
8.3.40.0110.00418.43
8.3.30.0040.01118.63
8.3.20.0060.00319.63
8.3.10.0080.00021.96
8.3.00.0000.00823.51
8.2.300.0120.00817.96
8.2.290.0130.00520.16
8.2.280.0090.00618.39
8.2.270.0070.01117.09
8.2.260.0090.00918.25
8.2.250.0150.00318.04
8.2.240.0060.00318.86
8.2.230.0080.00822.58
8.2.220.0040.00437.54
8.2.210.0120.00626.77
8.2.200.0040.01116.50
8.2.190.0110.00416.58
8.2.180.0120.00318.16
8.2.170.0070.00722.96
8.2.160.0030.01020.27
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0080.00019.33
8.2.110.0030.00619.45
8.2.100.0080.00417.66
8.2.90.0040.00419.34
8.2.80.0000.00817.50
8.2.70.0000.00817.38
8.2.60.0030.00517.91
8.2.50.0050.00318.07
8.2.40.0000.00819.78
8.2.30.0000.00720.39
8.2.20.0050.00218.07
8.2.10.0000.00717.98
8.2.00.0040.00418.22
8.1.340.0080.00917.17
8.1.330.0100.00923.73
8.1.320.0160.00315.80
8.1.310.0090.00018.58
8.1.300.0050.00320.34
8.1.290.0120.00330.84
8.1.280.0030.01325.92
8.1.270.0000.00724.66
8.1.260.0040.00726.35
8.1.250.0120.00428.09
8.1.240.0060.00322.11
8.1.230.0120.00320.95
8.1.220.0000.00717.74
8.1.210.0060.00318.77
8.1.200.0070.00317.35
8.1.190.0040.00417.22
8.1.180.0060.00318.84
8.1.170.0000.00817.62
8.1.160.0000.00718.76
8.1.150.0040.00420.28
8.1.140.0040.00419.52
8.1.130.0030.00318.92
8.1.120.0040.00417.43
8.1.110.0040.00417.32
8.1.100.0060.00317.41
8.1.90.0070.00017.43
8.1.80.0000.00717.44
8.1.70.0070.00017.30
8.1.60.0000.00717.54
8.1.50.0000.00817.39
8.1.40.0000.00717.35
8.1.30.0000.00817.55
8.1.20.0060.00317.61
8.1.10.0040.00417.57
8.1.00.0060.00317.47
8.0.300.0000.00720.08
8.0.290.0000.00716.63
8.0.280.0000.00818.33
8.0.270.0000.00717.19
8.0.260.0050.00217.12
8.0.250.0030.00316.84
8.0.240.0080.00416.96
8.0.230.0030.00316.93
8.0.220.0000.00716.74
8.0.210.0030.00316.82
8.0.200.0070.00016.86
8.0.190.0000.01016.82
8.0.180.0040.00416.89
8.0.170.0040.00416.83
8.0.160.0000.00916.95
8.0.150.0000.00716.83
8.0.140.0040.00416.70
8.0.130.0000.00813.19
8.0.120.0020.00516.71
8.0.110.0030.00516.79
8.0.100.0030.00316.84
8.0.90.0070.00016.90
8.0.80.0030.01116.79
8.0.70.0050.00316.82
8.0.60.0000.00716.91
8.0.50.0000.00716.86
8.0.30.0140.00717.11
8.0.20.0130.00717.40
8.0.10.0000.00816.85
8.0.00.0150.00416.74
7.4.330.0020.00215.55
7.4.320.0070.00016.53
7.4.300.0030.00316.46
7.4.290.0000.00816.56
7.4.280.0050.00316.46
7.4.270.0000.00716.60
7.4.260.0030.00316.52
7.4.250.0070.00016.43
7.4.240.0000.00716.55
7.4.230.0070.00016.62
7.4.220.0150.00916.55
7.4.210.0090.00816.54
7.4.200.0000.00816.55
7.4.160.0090.00716.24
7.4.150.0090.01517.40
7.4.140.0090.01117.86
7.4.130.0080.01116.45
7.4.120.0120.00916.54
7.4.110.0100.00716.42
7.4.100.0090.00716.42
7.4.90.0120.00416.45
7.4.80.0100.01119.39
7.4.70.0100.00716.41
7.4.60.0060.01216.48
7.4.50.0030.01016.45
7.4.40.0080.00816.36
7.4.30.0030.01416.43
7.4.00.0070.01114.79
7.3.330.0000.00612.95
7.3.320.0000.00513.21
7.3.310.0030.00316.28
7.3.300.0070.00016.13
7.3.290.0030.00316.16
7.3.280.0100.01016.17
7.3.270.0040.01317.40
7.3.260.0170.00216.36
7.3.250.0070.01016.22
7.3.240.0120.00916.24
7.3.230.0040.01216.44
7.3.210.0140.01016.23
7.3.200.0060.00916.37
7.3.190.0090.00616.14
7.3.180.0060.01016.23
7.3.170.0060.01516.13
7.3.160.0080.00716.20
7.3.120.0030.01014.39
7.3.110.0110.00714.68
7.3.100.0000.00914.70
7.3.90.0110.00414.71
7.3.80.0080.00814.82
7.3.70.0090.00614.83
7.3.60.0060.00914.51
7.3.50.0130.00014.62
7.3.40.0090.00614.58
7.3.30.0070.00414.61
7.3.20.0030.01016.55
7.3.10.0100.00516.58
7.3.00.0030.00716.46
7.2.330.0060.01516.23
7.2.320.0040.01216.67
7.2.310.0160.00016.56
7.2.300.0100.00716.50
7.2.290.0060.01216.59
7.2.250.0130.00314.96
7.2.240.0060.01014.83
7.2.230.0000.01214.86
7.2.220.0110.00714.95
7.2.210.0090.00615.04
7.2.200.0110.00614.71
7.2.190.0070.01114.65
7.2.180.0090.00014.95
7.2.170.0030.00614.93
7.2.130.0090.00316.84
7.2.120.0050.01016.71
7.2.110.0050.00716.61
7.2.100.0070.00716.82
7.2.90.0050.00816.67
7.2.80.0140.00216.77
7.2.70.0060.00916.57
7.2.60.0100.00616.60
7.2.50.0110.00516.59
7.2.40.0060.00516.88
7.2.30.0070.00316.91
7.2.20.0080.00516.78
7.2.10.0080.01016.55
7.2.00.0040.00616.64
7.1.330.0000.01515.85
7.1.320.0030.01015.60
7.1.310.0040.00715.74
7.1.300.0090.00615.70
7.1.290.0070.00715.72
7.1.280.0090.00315.54
7.1.270.0000.00915.59
7.1.260.0000.01515.91
7.1.250.0020.01015.65
7.1.240.0030.00815.77
7.1.230.0070.01015.47
7.1.220.0100.00615.43
7.1.210.0070.00415.48
7.1.200.0070.00515.57
7.1.190.0030.00915.64
7.1.180.0060.00615.64
7.1.170.0040.00415.47
7.1.160.0070.01015.54
7.1.150.0110.00415.60
7.1.140.0060.00615.72
7.1.130.0060.00315.44
7.1.120.0070.00415.37
7.1.110.0040.00815.46
7.1.100.0060.00615.86
7.1.90.0030.01015.71
7.1.80.0070.01015.73
7.1.70.0060.00416.53
7.1.60.0070.00516.44
7.1.50.0090.00316.39
7.1.40.0050.00716.04
7.1.30.0020.01116.21
7.1.20.0070.00516.01
7.1.10.0060.00816.01
7.1.00.0020.00616.15
7.0.330.0030.00715.29
7.0.320.0090.00315.11
7.0.310.0090.00015.35
7.0.300.0070.00714.97
7.0.290.0000.01215.14
7.0.280.0000.01215.19
7.0.270.0150.00615.15
7.0.260.0120.00315.00
7.0.250.0100.00715.29
7.0.240.0120.00314.95
7.0.230.0080.00814.91
7.0.220.0040.00415.37
7.0.210.0050.00314.83
7.0.200.0040.00515.89
7.0.190.0060.00616.08
7.0.180.0000.00915.68
7.0.170.0070.00515.68
7.0.160.0070.00515.79
7.0.150.0040.00915.64
7.0.140.0040.00815.58
7.0.130.0050.00715.85
7.0.120.0050.00315.91
7.0.110.0030.01015.63
7.0.100.0060.00515.78
7.0.90.0030.00715.87
7.0.80.0030.00815.65
7.0.70.0030.00715.83
7.0.60.0070.00415.70
7.0.50.0050.00615.77
7.0.40.0050.00714.30
7.0.30.0060.00314.21
7.0.20.0050.00714.26
7.0.10.0070.00714.09
7.0.00.0030.01014.17
5.6.380.0000.01413.74

preferences:
30.18 ms | 403 KiB | 5 Q