3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "\tA\t B \tC \t D "; var_export( [ 'input' => $string, 'space, no flag' => preg_split('~ +~', $string), 'space, flag' => preg_split('~ +~', $string, -1, PREG_SPLIT_NO_EMPTY), 'tab, no flag' => preg_split('~\t+~', $string), 'tab, flag' => preg_split('~\t+~', $string, -1, PREG_SPLIT_NO_EMPTY), 'whitespace, no flag' => preg_split('~\s+~', $string), 'whitespace, flag' => preg_split('~\s+~', $string, -1, PREG_SPLIT_NO_EMPTY), 'tab&space, no flag' => preg_split('~[\t ]+~', $string), 'tab&space, flag' => preg_split('~[\t ]+~', $string, -1, PREG_SPLIT_NO_EMPTY), 'horizontal whitespace, no flag' => preg_split('~\h+~', $string), 'horizontal whitespace, flag' => preg_split('~\h+~', $string, -1, PREG_SPLIT_NO_EMPTY), ] );

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.0050.00420.63
8.4.110.0100.01119.77
8.4.100.0030.00718.94
8.4.90.0040.01019.77
8.4.80.0070.00520.75
8.4.70.0080.00918.11
8.4.60.0100.01118.79
8.4.50.0100.00620.75
8.4.40.0110.00719.44
8.4.30.0100.01020.51
8.4.20.0080.00418.88
8.4.10.0060.00317.73
8.3.250.0090.01120.71
8.3.240.0090.01016.92
8.3.230.0100.00816.89
8.3.220.0050.00318.90
8.3.210.0090.00516.83
8.3.200.0070.00216.74
8.3.190.0040.00617.41
8.3.180.0110.00817.38
8.3.170.0090.00620.38
8.3.160.0040.00818.31
8.3.150.0040.00417.25
8.3.140.0090.00917.35
8.3.130.0030.00518.64
8.3.120.0030.00719.02
8.3.110.0050.00517.13
8.3.100.0180.00833.04
8.3.90.0100.01026.77
8.3.80.0030.00616.88
8.3.70.0110.00418.56
8.3.60.0120.00916.75
8.3.50.0120.00618.16
8.3.40.0130.00318.69
8.3.30.0130.00718.76
8.3.20.0040.01124.18
8.3.10.0080.00024.66
8.3.00.0000.00726.16
8.2.290.0150.00616.66
8.2.280.0070.01216.81
8.2.270.0040.01517.27
8.2.260.0000.00818.59
8.2.250.0100.00018.52
8.2.240.0050.00519.39
8.2.230.0070.00720.94
8.2.220.0100.00037.54
8.2.210.0180.00026.77
8.2.200.0110.00417.00
8.2.190.0140.00716.75
8.2.180.0120.00625.92
8.2.170.0070.00718.91
8.2.160.0140.00322.96
8.2.150.0040.00425.66
8.2.140.0090.00624.66
8.2.130.0080.00026.16
8.2.120.0070.00026.16
8.2.110.0060.00321.02
8.2.100.0110.00018.03
8.2.90.0090.00018.22
8.2.80.0050.00520.65
8.2.70.0040.00417.75
8.2.60.0000.00818.04
8.2.50.0030.00618.07
8.2.40.0000.00818.28
8.2.30.0000.00718.27
8.2.20.0040.00418.16
8.2.10.0080.00019.28
8.2.00.0000.00719.33
8.1.330.0090.01016.48
8.1.320.0110.00816.38
8.1.310.0090.00918.38
8.1.300.0090.00916.85
8.1.290.0060.00318.88
8.1.280.0200.00525.92
8.1.270.0040.00424.66
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0040.00422.19
8.1.230.0070.00320.84
8.1.220.0050.00317.74
8.1.210.0050.00318.77
8.1.200.0000.00817.47
8.1.190.0030.00617.47
8.1.180.0040.00418.10
8.1.170.0040.00418.75
8.1.160.0000.00818.95
8.1.150.0040.00418.97
8.1.140.0040.00419.13
8.1.130.0030.00320.44
8.1.120.0000.00717.51
8.1.110.0030.00617.59
8.1.100.0040.00417.57
8.1.90.0070.00017.57
8.1.80.0030.00617.54
8.1.70.0040.00417.59
8.1.60.0000.00817.56
8.1.50.0040.00417.68
8.1.40.0050.00317.47
8.1.30.0000.00817.66
8.1.20.0030.00617.72
8.1.10.0050.00317.59
8.1.00.0070.00017.54
8.0.300.0000.00720.21
8.0.290.0020.00516.75
8.0.280.0000.00718.36
8.0.270.0030.00318.13
8.0.260.0000.00618.62
8.0.250.0030.00317.05
8.0.240.0080.00017.09
8.0.230.0090.00017.09
8.0.220.0030.00316.95
8.0.210.0030.00316.96
8.0.200.0000.00717.05
8.0.190.0040.00417.09
8.0.180.0030.00517.07
8.0.170.0060.00316.97
8.0.160.0000.00817.00
8.0.150.0070.00016.93
8.0.140.0090.00016.79
8.0.130.0060.00013.43
8.0.120.0050.00317.05
8.0.110.0040.00416.96
8.0.100.0040.00417.09
8.0.90.0000.00817.13
8.0.80.0140.01117.02
8.0.70.0060.01616.94
8.0.60.0150.00617.05
8.0.50.0080.01116.92
8.0.30.0130.00917.02
8.0.20.0080.00817.09
8.0.10.0040.01217.20
8.0.00.0110.01117.16
7.4.330.0030.00315.55
7.4.320.0060.00016.72
7.4.300.0000.00716.84
7.4.290.0040.00416.77
7.4.280.0000.00716.74
7.4.270.0040.00416.88
7.4.260.0030.00313.52
7.4.250.0000.00716.73
7.4.240.0020.00516.81
7.4.230.0080.00016.71
7.4.220.0070.00016.58
7.4.210.0100.00516.70
7.4.200.0220.00416.81
7.4.190.0180.00916.54
7.4.180.0160.00316.66
7.4.160.0170.00616.88
7.4.150.0150.00316.73
7.4.140.0120.00916.68
7.4.130.0100.01016.53
7.4.120.0170.00516.60
7.4.110.0120.00716.54
7.4.100.0080.00816.71
7.4.90.0040.01816.72
7.4.80.0140.00516.68
7.4.70.0160.00516.51
7.4.60.0090.00916.59
7.4.50.0100.01016.45
7.4.40.0130.00916.52
7.4.30.0100.00616.57
7.4.20.0070.01016.71
7.4.10.0120.00916.65
7.4.00.0150.00416.58
7.3.330.0040.00416.34
7.3.320.0050.00013.26
7.3.310.0070.00016.24
7.3.300.0000.00716.42
7.3.290.0120.00716.39
7.3.280.0100.01116.37
7.3.270.0210.00016.38
7.3.260.0190.00416.35
7.3.250.0190.00316.30
7.3.240.0030.01216.43
7.3.230.0190.00316.13
7.3.220.0170.00416.30
7.3.210.0130.00316.33
7.3.200.0180.01116.27
7.3.190.0140.00716.36
7.3.180.0080.00816.24
7.3.170.0170.00016.29
7.3.160.0120.00616.25
7.3.150.0170.00416.27
7.3.140.0160.00416.39
7.3.130.0250.00016.19
7.3.120.0120.00916.34
7.3.110.0180.01016.20
7.3.100.0030.01316.20
7.3.90.0160.01016.56
7.3.80.0070.00716.40
7.3.70.0060.01516.52
7.3.60.0120.00916.47
7.3.50.0030.01416.43
7.3.40.0160.00016.46
7.3.30.0150.00816.50
7.3.20.0770.01216.47
7.3.10.0130.00316.28
7.3.00.0070.01516.45

preferences:
27.85 ms | 403 KiB | 5 Q