3v4l.org

run code in 300+ PHP versions simultaneously
<?php function wordSafeSplit(string $text, int $pieces = 2): array { $maxLength = intdiv(strlen($text), $pieces); return preg_split( "~.{0,$maxLength}\K\s~s", $text, $pieces ); } $text = "The Quick : Brown Fox Jumped Over The Lazy / Dog"; var_export(wordSafeSplit($text));

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.0100.00816.79
8.5.00.0100.01120.32
8.4.150.0010.00114.05
8.4.140.0130.00917.95
8.4.130.0100.01118.57
8.4.120.0070.00524.17
8.4.110.0130.00818.76
8.4.100.0140.00717.70
8.4.90.0090.00918.01
8.4.80.0040.00417.99
8.4.70.0070.00217.96
8.4.60.0110.01317.79
8.4.50.0110.00717.88
8.4.40.0130.00618.81
8.4.30.0080.00418.81
8.4.20.0090.00019.85
8.4.10.0040.00419.62
8.3.280.0090.01118.39
8.3.270.0120.00716.75
8.3.260.0160.00316.61
8.3.250.0120.00618.64
8.3.240.0120.00717.16
8.3.230.0120.00816.50
8.3.220.0100.00217.33
8.3.210.0040.00316.79
8.3.200.0140.00616.70
8.3.190.0100.00816.45
8.3.180.0100.00616.46
8.3.170.0180.00020.59
8.3.160.0120.00620.91
8.3.150.0000.00816.54
8.3.140.0040.00418.88
8.3.130.0000.00818.57
8.3.120.0040.00420.85
8.3.110.0090.00020.94
8.3.100.0000.00824.06
8.3.90.0030.00526.77
8.3.80.0030.00618.43
8.3.70.0140.00718.43
8.3.60.0130.00318.45
8.3.50.0120.00616.87
8.3.40.0360.01117.50
8.3.30.0330.01517.50
8.3.20.0380.00717.63
8.3.10.0330.01117.63
8.3.00.0300.01317.63
8.2.290.0120.00520.76
8.2.280.0120.00716.83
8.2.270.0100.01016.58
8.2.260.0060.01217.19
8.2.250.0080.00016.87
8.2.240.0050.00518.90
8.2.230.0040.00422.58
8.2.220.0160.00037.54
8.2.210.0000.00826.77
8.2.200.0030.00618.54
8.2.190.0160.00617.00
8.2.180.0150.00318.66
8.2.170.0390.01417.38
8.2.160.0330.00617.63
8.2.150.0290.01117.63
8.2.140.0290.01017.38
8.2.130.0300.00817.50
8.2.120.0310.00417.63
8.2.110.0280.00717.50
8.2.100.0310.00617.13
8.2.90.0170.01117.47
8.2.80.0190.01217.38
8.2.70.0240.01017.38
8.2.60.0230.00317.50
8.2.50.0230.00317.63
8.2.40.0250.00317.38
8.2.30.0300.00616.75
8.2.20.0250.00017.25
8.2.10.0220.00317.25
8.2.00.0250.00016.99
8.1.330.0090.00921.80
8.1.320.0090.00816.15
8.1.310.0000.00716.83
8.1.300.0100.01020.19
8.1.290.0060.00318.88
8.1.280.0100.01025.92
8.1.270.0230.00517.00
8.1.260.0190.00617.38
8.1.250.0200.01417.13
8.1.240.0200.01017.13
8.1.230.0150.01117.25
8.1.220.0300.00316.73
8.1.210.0220.00416.86
8.1.200.0120.01217.00
8.1.190.0140.01016.98
8.1.180.0200.00417.13
8.1.170.0230.00716.75
8.1.160.0180.00716.75
8.1.150.0140.01117.22
8.1.140.0150.01116.97
8.1.130.0290.01516.72
8.1.120.0200.00716.96
8.1.110.0250.00017.13
8.1.100.0140.01117.25
8.1.90.0170.00716.97
8.1.80.0160.00817.38
8.1.70.0270.00416.88
8.1.60.0240.00817.50
8.1.50.0140.01117.50
8.1.40.0250.00717.38
8.1.30.0280.00417.22
8.1.20.0290.00717.00
8.1.10.0180.01817.50
8.1.00.0220.01016.98

preferences:
37.33 ms | 403 KiB | 5 Q