3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "This is a string"; $words = []; $spaces = []; foreach (preg_split('~( +)~', $string, -1, 3) as $s) { if (ctype_space($s)) { $spaces[] = strlen($s); } else { $words[] = $s; } } var_export([ 'words' => $words, 'spaces' => $spaces ]);

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.70.0110.00718.68
8.3.60.0070.01116.63
8.3.50.0090.00918.40
8.3.40.0110.00718.88
8.3.30.0140.00318.97
8.3.20.0050.00324.18
8.3.10.0040.00424.66
8.3.00.0070.00026.16
8.2.190.0080.00816.88
8.2.180.0070.01425.92
8.2.170.0070.01019.26
8.2.160.0110.00422.96
8.2.150.0000.00825.66
8.2.140.0050.00224.66
8.2.130.0050.00226.16
8.2.120.0040.00426.16
8.2.110.0110.00022.23
8.2.100.0030.00720.54
8.2.90.0000.00817.88
8.2.80.0040.00418.81
8.2.70.0000.00719.34
8.2.60.0040.00417.75
8.2.50.0040.00417.88
8.2.40.0040.00417.88
8.2.30.0060.00318.05
8.2.20.0080.00018.11
8.2.10.0040.00419.27
8.2.00.0070.00019.16
8.1.280.0060.01025.92
8.1.270.0050.00323.99
8.1.260.0090.00626.35
8.1.250.0000.00828.09
8.1.240.0060.00323.82
8.1.230.0110.00419.16
8.1.220.0040.00417.79
8.1.210.0030.00618.77
8.1.200.0000.00817.36
8.1.190.0050.00317.35
8.1.180.0000.00818.10
8.1.170.0040.00417.62
8.1.160.0040.00419.09
8.1.150.0050.00318.91
8.1.140.0030.00518.94
8.1.130.0030.00320.20
8.1.120.0040.00417.63
8.1.110.0070.00317.49
8.1.100.0000.00717.44
8.1.90.0000.00717.50
8.1.80.0000.00717.62
8.1.70.0000.00717.51
8.1.60.0030.00617.61
8.1.50.0050.00517.66
8.1.40.0000.00917.68
8.1.30.0040.00417.83
8.1.20.0000.00817.87
8.1.10.0040.00417.73
8.1.00.0000.00717.67
8.0.300.0000.01019.75
8.0.290.0000.00816.88
8.0.280.0070.00018.38
8.0.270.0050.00318.16
8.0.260.0030.00318.46
8.0.250.0040.00417.13
8.0.240.0040.00417.02
8.0.230.0000.00717.06
8.0.220.0030.00317.09
8.0.210.0000.00717.06
8.0.200.0000.00617.07
8.0.190.0040.00417.09
8.0.180.0000.00716.95
8.0.170.0050.00317.11
8.0.160.0080.00017.02
8.0.150.0030.00616.99
8.0.140.0070.00317.02
8.0.130.0050.00013.51
8.0.120.0000.00816.88
8.0.110.0050.00317.00
8.0.100.0020.00716.96
8.0.90.0050.00417.03
8.0.80.0050.00916.98
8.0.70.0100.00717.01
8.0.60.0110.00516.91
8.0.50.0050.00816.99
8.0.30.0130.00417.07
8.0.20.0130.00317.09
8.0.10.0110.00716.99
8.0.00.0050.01017.20
7.4.330.0000.00415.55
7.4.320.0000.00616.77
7.4.300.0030.00516.79
7.4.290.0030.00316.75
7.4.280.0070.00016.84
7.4.270.0030.00316.77
7.4.260.0030.00313.49
7.4.250.0040.00416.68
7.4.240.0050.00516.70
7.4.230.0100.00016.68
7.4.220.0010.00816.81
7.4.210.0040.01116.79
7.4.200.0070.00816.75
7.4.190.0060.00616.75
7.4.180.0080.00316.91
7.4.160.0060.00616.82
7.4.150.0040.00916.76
7.4.140.0110.00316.75
7.4.130.0050.00816.75
7.4.120.0060.00716.82
7.4.110.0090.00616.77
7.4.100.0100.00216.84
7.4.90.0070.00816.78
7.4.80.0060.00816.76
7.4.70.0140.00016.74
7.4.60.0110.00216.70
7.4.50.0080.00616.60
7.4.40.0050.00716.64
7.4.30.0050.00716.68
7.4.20.0070.00516.75
7.4.10.0070.00516.71
7.4.00.0060.00616.65
7.3.330.0050.00516.39
7.3.320.0000.00613.45
7.3.310.0070.00416.54
7.3.300.0040.00516.38
7.3.290.0100.00516.59
7.3.280.0110.00116.38
7.3.270.0120.00316.41
7.3.260.0060.00916.42
7.3.250.0090.00616.54
7.3.240.0090.00816.49
7.3.230.0040.01016.44
7.3.220.0060.00816.43
7.3.210.0050.01216.45
7.3.200.0080.00516.32
7.3.190.0090.00516.51
7.3.180.0060.00716.42
7.3.170.0060.00616.38
7.3.160.0050.00716.39
7.3.150.0070.00616.31
7.3.140.0030.00916.41
7.3.130.0030.01016.29
7.3.120.0030.01216.38
7.3.110.0050.00716.35
7.3.100.0090.00416.29
7.3.90.0060.00816.74
7.3.80.0070.00616.47
7.3.70.0070.00816.38
7.3.60.0070.00516.55
7.3.50.0100.00216.56
7.3.40.0000.01216.50
7.3.30.0050.01016.53
7.3.20.0090.00717.52
7.3.10.0110.00517.46
7.3.00.0100.00717.44

preferences:
22.83 ms | 401 KiB | 5 Q