3v4l.org

run code in 300+ PHP versions simultaneously
<?php function uniqueNoEmpty($array) { return array_unique(array_filter($array, 'strlen')); } $original_string = 'one two three 喞 喝 four 刷囿 two 跏正 吁'; if (!preg_match_all('~(\p{Han}+)|(\S+)~u', $original_string, $out)) { echo 'no qualifying strings'; } else { $singleBytes = uniqueNoEmpty($out[2]) ?? []; $multiBytes = array_reverse(uniqueNoEmpty($out[1])); echo implode(' ', array_merge($singleBytes,$multiBytes)); }

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.4.120.0110.00920.93
8.4.110.0140.00622.61
8.4.100.0120.00918.00
8.4.90.0120.01018.87
8.4.80.0090.01117.89
8.4.70.0100.00618.18
8.4.60.0130.00718.58
8.4.50.0090.00818.32
8.4.40.0030.01620.30
8.4.30.0060.01324.15
8.4.20.0100.01019.76
8.4.10.0080.00019.90
8.3.250.0110.00818.87
8.3.240.0060.00217.28
8.3.230.0100.01116.73
8.3.220.0100.00818.99
8.3.210.0140.00416.69
8.3.200.0080.00116.89
8.3.190.0120.00717.35
8.3.180.0140.00616.80
8.3.170.0070.01017.31
8.3.160.0120.00618.63
8.3.150.0070.01120.54
8.3.140.0110.00316.89
8.3.130.0000.00818.44
8.3.120.0030.00620.66
8.3.110.0030.00618.50
8.3.100.0060.00316.75
8.3.90.0180.00026.77
8.3.80.0040.00819.36
8.3.70.0150.00616.74
8.3.60.0150.00618.43
8.3.50.0120.00523.66
8.3.40.0110.00719.07
8.3.30.0080.00818.92
8.3.20.0050.00320.85
8.3.10.0040.00422.08
8.3.00.0040.00421.73
8.2.290.0080.01120.49
8.2.280.0080.01118.75
8.2.270.0000.01817.05
8.2.260.0100.01018.38
8.2.250.0030.00518.98
8.2.240.0050.00318.82
8.2.230.0100.00020.94
8.2.220.0080.00024.06
8.2.210.0070.01126.77
8.2.200.0040.00718.88
8.2.190.0180.00016.75
8.2.180.0090.00617.00
8.2.170.0090.00622.96
8.2.160.0120.00622.25
8.2.150.0120.00024.18
8.2.140.0040.00424.66
8.2.130.0030.00526.16
8.2.120.0000.00826.16
8.2.110.0070.00721.17
8.2.100.0120.00018.29
8.2.90.0050.00317.88
8.2.80.0030.00517.97
8.2.70.0040.00417.88
8.2.60.0000.00818.16
8.2.50.0040.00418.07
8.2.40.0000.00918.29
8.2.30.0030.00518.18
8.2.20.0040.00418.30
8.2.10.0000.00719.55
8.2.00.0040.00419.41
8.1.330.0110.00722.22
8.1.320.0110.00816.33
8.1.310.0090.00018.23
8.1.300.0080.00017.03
8.1.290.0030.00630.84
8.1.280.0110.01125.92
8.1.270.0090.00021.00
8.1.260.0000.00926.35
8.1.250.0040.00428.09
8.1.240.0140.00319.39
8.1.230.0070.00417.96
8.1.220.0050.00317.91
8.1.210.0080.00018.77
8.1.200.0030.00617.60
8.1.190.0040.00417.48
8.1.180.0000.00818.10
8.1.170.0060.00318.73
8.1.160.0080.00018.99
8.1.150.0040.00419.11
8.1.140.0000.00720.92
8.1.130.0050.00320.15
8.1.120.0050.00217.55
8.1.110.0040.00417.60
8.1.100.0040.00417.46
8.1.90.0000.00717.59
8.1.80.0030.00517.54
8.1.70.0040.00417.50
8.1.60.0050.00317.64
8.1.50.0050.00317.69
8.1.40.0030.00617.58
8.1.30.0060.00317.76
8.1.20.0100.00017.66
8.1.10.0100.00017.71
8.1.00.0050.00317.70
8.0.300.0070.00018.96
8.0.290.0000.00717.00
8.0.280.0070.00018.60
8.0.270.0070.00018.20
8.0.260.0030.00320.14
8.0.250.0080.00017.23
8.0.240.0030.00517.18
8.0.230.0000.00817.13
8.0.220.0070.00017.14
8.0.210.0000.00717.19
8.0.200.0030.00317.25
8.0.190.0050.00217.11
8.0.180.0000.00817.26
8.0.170.0090.00017.10
8.0.160.0040.00417.25
8.0.150.0040.00417.07
8.0.140.0040.00417.11
8.0.130.0000.00613.63
8.0.120.0040.00417.16
8.0.110.0040.00417.29
8.0.100.0060.00317.12
8.0.90.0000.00917.06
8.0.80.0070.01117.16
8.0.70.0040.00417.21
8.0.60.0000.00717.12
8.0.50.0040.00417.20
8.0.30.0090.00917.39
8.0.20.0070.01217.41
8.0.10.0050.00317.25
8.0.00.0120.00616.93
7.4.330.0030.00316.84
7.4.320.0060.00016.90
7.4.300.0060.00016.71
7.4.290.0040.00416.81
7.4.280.0060.00316.84
7.4.270.0030.00316.91
7.4.260.0030.00313.57
7.4.250.0040.00416.86
7.4.240.0040.00416.88
7.4.230.0030.00316.90
7.4.220.0030.00516.93
7.4.210.0080.01016.88
7.4.200.0040.00417.00
7.4.130.0150.00916.62
7.4.120.0090.00916.76
7.4.110.0130.00316.64
7.4.100.0130.01316.77
7.4.90.0030.01316.87
7.4.80.0110.00519.39
7.4.70.0100.00616.52
7.4.60.0080.00816.79
7.4.50.0120.00317.00
7.4.40.0100.00716.96
7.4.10.0120.00315.06
7.4.00.0080.00815.00
7.3.330.0040.00416.62
7.3.320.0030.00313.57
7.3.310.0030.00516.54
7.3.300.0000.00716.40
7.3.290.0110.00616.46
7.3.280.0140.00016.47
7.3.260.0160.00916.58
7.3.240.0090.00816.60
7.3.230.0160.00616.52
7.3.210.0100.00716.80
7.3.200.0170.00616.56
7.3.190.0120.00616.47
7.3.180.0120.00616.68
7.3.170.0060.01316.70
7.3.160.0100.00716.84
7.3.130.0090.00514.94
7.3.120.0100.00514.91
7.3.110.0050.01014.99
7.3.100.0030.01114.84
7.3.90.0040.01114.91
7.3.80.0090.00614.94
7.3.70.0090.00414.78
7.3.60.0060.00714.82
7.3.50.0060.00814.72
7.3.40.0060.00814.97
7.3.30.0040.00914.95
7.3.20.0070.00814.79
7.3.10.0050.00915.01
7.3.00.0090.00615.04
7.2.330.0030.01416.70
7.2.320.0060.01216.98
7.2.310.0100.01016.80
7.2.300.0120.01217.04
7.2.290.0110.00716.88
7.2.260.0050.01415.27
7.2.250.0120.00715.22
7.2.240.0100.00515.25
7.2.230.0090.00715.26
7.2.220.0070.00815.13
7.2.210.0090.00615.06
7.2.200.0070.00715.09
7.2.190.0030.01315.15
7.2.180.0070.00715.27
7.2.170.0050.00915.04
7.2.160.0130.00115.18
7.2.150.0110.00414.98
7.2.140.0080.00915.29
7.2.130.0060.01215.13
7.2.120.0050.01015.10
7.2.110.0020.01315.31
7.2.100.0020.01315.29
7.2.90.0090.00715.30
7.2.80.0320.00715.16
7.2.70.0100.00615.21
7.2.60.0070.00915.11
7.2.50.0090.00615.17
7.2.40.0030.01315.12
7.2.30.0130.00315.36
7.2.20.0070.00815.01
7.2.10.0060.01115.18
7.2.00.0100.00515.18

preferences:
28.94 ms | 403 KiB | 5 Q