3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string='先秦兩漢'; var_export(preg_split('~~u', $string, 0, PREG_SPLIT_NO_EMPTY)); echo "\n---\n"; var_export(preg_split('~\X\K~u', $string, 0, PREG_SPLIT_NO_EMPTY)); echo "\n---\n"; var_export(preg_split('~\X\K(?!$)~u', $string)); echo "\n---\n"; var_export(mb_split('\X\K(?!$)', $string)); echo "\n---\n"; var_export(preg_match_all('~\X~u', $string, $out) ? $out[0] : []);

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.130.0040.00418.69
8.3.120.0000.01019.07
8.3.110.0100.00016.88
8.3.100.0070.00318.84
8.3.90.0000.00818.68
8.3.80.0050.00518.55
8.3.70.0060.01018.93
8.3.60.0180.00418.63
8.3.50.0130.00318.64
8.3.40.0140.00419.04
8.3.30.0110.00419.10
8.3.20.0040.00420.98
8.3.10.0040.00421.89
8.3.00.0050.00221.97
8.2.250.0000.00816.94
8.2.240.0060.00317.34
8.2.230.0080.00320.94
8.2.220.0050.00537.54
8.2.210.0120.00326.77
8.2.200.0050.00519.04
8.2.190.0070.01018.75
8.2.180.0090.00916.63
8.2.170.0100.00722.96
8.2.160.0100.00320.45
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0030.00619.91
8.2.120.0040.00426.35
8.2.110.0040.00721.14
8.2.100.0060.00618.34
8.2.90.0040.00418.34
8.2.80.0080.00018.05
8.2.70.0000.00817.88
8.2.60.0040.00417.88
8.2.50.0000.00817.88
8.2.40.0000.00819.55
8.2.30.0000.00820.72
8.2.20.0040.00418.26
8.2.10.0030.00519.57
8.2.00.0040.00418.05
8.1.300.0000.00818.63
8.1.290.0060.00318.88
8.1.280.0090.00925.92
8.1.270.0000.00822.14
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00721.12
8.1.230.0090.00322.78
8.1.220.0090.00017.76
8.1.210.0050.00318.77
8.1.200.0030.00617.50
8.1.190.0030.00617.47
8.1.180.0060.00618.10
8.1.170.0080.00018.77
8.1.160.0040.00418.91
8.1.150.0000.00818.97
8.1.140.0000.00719.03
8.1.130.0030.00320.32
8.1.120.0040.00417.68
8.1.110.0040.00417.59
8.1.100.0030.00517.67
8.1.90.0070.00017.55
8.1.80.0030.00617.55
8.1.70.0000.00817.64
8.1.60.0060.00317.83
8.1.50.0050.00417.72
8.1.40.0040.00417.64
8.1.30.0040.00417.84
8.1.20.0000.01017.82
8.1.10.0000.00817.82
8.1.00.0050.00317.80
8.0.300.0080.00019.88
8.0.290.0060.00317.13
8.0.280.0000.00818.56
8.0.270.0030.00317.40
8.0.260.0040.00418.61
8.0.250.0070.00017.17
8.0.240.0030.00617.34
8.0.230.0040.00417.26
8.0.220.0000.00717.23
8.0.210.0040.00417.10
8.0.200.0070.00017.27
8.0.190.0040.00417.32
8.0.180.0080.00017.26
8.0.170.0000.00917.12
8.0.160.0040.00417.12
8.0.150.0040.00417.23
8.0.140.0000.00717.20
8.0.130.0030.00313.69
8.0.120.0070.00017.19
8.0.110.0040.00417.23
8.0.100.0020.00517.25
8.0.90.0000.00717.10
8.0.80.0000.01517.15
8.0.70.0040.00417.10
8.0.60.0000.00717.14
8.0.50.0040.00417.02
8.0.30.0100.01017.39
8.0.20.0170.01017.52
8.0.10.0020.00517.17
8.0.00.0130.00817.03
7.4.330.0000.00516.68
7.4.320.0030.00316.86
7.4.300.0080.00016.86
7.4.290.0000.00716.83
7.4.280.0050.00316.85
7.4.270.0030.00316.83
7.4.260.0000.00716.90
7.4.250.0070.00016.95
7.4.240.0020.00516.92
7.4.230.0040.00416.87
7.4.220.0000.00816.88
7.4.210.0110.00716.90
7.4.200.0040.00416.85
7.4.160.0100.00516.78
7.4.130.0090.00916.68
7.4.120.0150.00816.71
7.4.110.0070.01116.55
7.4.100.0100.01316.92
7.4.90.0140.00616.66
7.4.80.0100.01319.39
7.4.70.0100.00716.73
7.4.60.0050.01016.90
7.4.50.0100.00316.65
7.4.40.0060.01816.71
7.4.00.0110.00715.21
7.3.330.0050.00013.29
7.3.320.0030.00313.41
7.3.310.0060.00016.38
7.3.300.0030.00316.50
7.3.290.0000.00716.53
7.3.280.0070.01016.53
7.3.260.0090.00816.72
7.3.240.0090.00916.62
7.3.230.0120.00616.73
7.3.210.0090.00916.76
7.3.200.0080.01216.72
7.3.190.0110.00616.60
7.3.180.0090.00916.48
7.3.170.0030.01416.78
7.3.160.0000.01616.59
7.3.40.0030.01014.98
7.3.30.0110.00714.93
7.3.20.0110.00216.76
7.3.10.0060.00716.91
7.3.00.0020.01216.70
7.2.330.0120.00616.83
7.2.320.0100.01416.71
7.2.310.0100.00616.91
7.2.300.0100.01516.63
7.2.290.0030.02016.89
7.2.170.0070.00815.11
7.2.160.0110.00215.13
7.2.150.0090.00617.05
7.2.140.0050.00916.93
7.2.130.0150.00516.83
7.2.120.0060.01017.02
7.2.110.0060.00617.08
7.2.100.0050.00917.11
7.2.90.0060.01017.08
7.2.80.0080.01016.98
7.2.70.0060.01517.13
7.2.60.0110.00616.95
7.2.50.0110.00516.88
7.2.40.0050.01717.14
7.2.30.0070.00717.05
7.2.20.0100.00917.01
7.2.10.0090.00517.05
7.2.00.0100.00317.03
7.1.280.0020.01215.95
7.1.270.0010.01116.00
7.1.260.0060.00815.88
7.1.250.0020.01415.94

preferences:
27.66 ms | 403 KiB | 5 Q