3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "This is my test case for an example"; function splitStrByWords($sentence, $wordCount=2) { $words = array_chunk( explode(' ', $sentence), $wordCount ); return array_map( 'implode', array_fill(0, sizeof($words), ' '), $words ); } var_export(splitStrByWords($string));

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.130.0060.00417.79
8.4.120.0120.00920.74
8.4.110.0110.00918.80
8.4.100.0040.00417.78
8.4.90.0120.00920.56
8.4.80.0060.00319.01
8.4.70.0100.00819.14
8.4.60.0110.01018.88
8.4.50.0090.01217.70
8.4.40.0150.00420.45
8.4.30.0080.00824.10
8.4.20.0070.01419.14
8.4.10.0150.00424.09
8.3.260.0120.00816.61
8.3.250.0080.01118.92
8.3.240.0100.00919.02
8.3.230.0120.00616.68
8.3.220.0110.00718.81
8.3.210.0040.00416.54
8.3.200.0070.00116.55
8.3.190.0080.00917.30
8.3.180.0120.00816.44
8.3.170.0090.00917.00
8.3.160.0110.00716.48
8.3.150.0110.00717.08
8.3.140.0120.00818.68
8.3.130.0060.00318.50
8.3.120.0080.00419.07
8.3.110.0050.00320.94
8.3.100.0060.00318.37
8.3.90.0030.00526.77
8.3.80.0040.00417.97
8.3.70.0140.00416.38
8.3.60.0150.00016.50
8.3.50.0170.00716.83
8.3.40.0110.00423.78
8.3.30.0090.00618.54
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0030.00726.16
8.2.290.0120.00816.71
8.2.280.0070.01118.30
8.2.270.0080.01117.05
8.2.260.0150.00416.45
8.2.250.0090.00016.59
8.2.240.0040.01217.13
8.2.230.0030.00722.58
8.2.220.0030.00624.06
8.2.210.0040.00426.77
8.2.200.0060.00318.29
8.2.190.0070.00716.58
8.2.180.0060.01216.38
8.2.170.0100.01018.79
8.2.160.0100.00322.96
8.2.150.0070.00025.66
8.2.140.0050.00224.66
8.2.130.0000.00826.16
8.2.120.0070.01119.70
8.2.110.0040.00422.22
8.2.100.0000.01117.78
8.2.90.0080.00020.63
8.2.80.0040.00417.97
8.2.70.0090.00017.93
8.2.60.0190.00017.13
8.2.50.0090.00917.13
8.2.40.0100.00617.13
8.2.30.0130.00417.50
8.2.20.0080.00817.38
8.2.10.0130.00417.50
8.2.00.0120.00517.62
8.1.330.0130.00516.14
8.1.320.0110.00816.08
8.1.310.0100.00318.43
8.1.300.0090.00015.97
8.1.290.0000.00930.84
8.1.280.0140.00425.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0070.00322.40
8.1.230.0080.00420.91
8.1.220.0050.00517.79
8.1.210.0000.00818.87
8.1.200.0080.00017.48
8.1.190.0050.00317.36
8.1.180.0030.01317.13
8.1.170.0140.00317.00
8.1.160.0150.00416.87
8.1.150.0120.00517.10
8.1.140.0060.01017.13
8.1.130.0140.00216.75
8.1.120.0110.00517.25
8.1.110.0090.00917.23
8.1.100.0180.00017.13
8.1.90.0170.00017.11
8.1.80.0060.01117.50
8.1.70.0130.00317.38
8.1.60.0150.00317.13
8.1.50.0150.00317.13
8.1.40.0150.00517.38
8.1.30.0150.00417.38
8.1.20.0150.00417.13
8.1.10.0000.01816.97
8.1.00.0120.00617.00
8.0.300.0040.00419.82
8.0.290.0050.00316.75
8.0.280.0140.00316.52
8.0.270.0120.00516.52
8.0.260.0120.00616.52
8.0.250.0170.00016.52
8.0.240.0110.00716.52
8.0.230.0170.00016.52
8.0.220.0090.00916.52
8.0.210.0120.00716.52
8.0.200.0090.00916.52
8.0.190.0090.00916.52
8.0.180.0140.00516.52
8.0.170.0070.01116.52
8.0.160.0100.00616.52
8.0.150.0040.01416.63
8.0.140.0080.00816.52
8.0.130.0080.00816.52
8.0.120.0130.00616.63
8.0.110.0130.00616.52
8.0.100.0120.00616.63
8.0.90.0060.01216.63
8.0.80.0150.00216.52
8.0.70.0060.01116.52
8.0.60.0080.00916.62
8.0.50.0080.00816.62
8.0.30.0170.00016.52
8.0.20.0140.00316.52
8.0.10.0090.00616.52

preferences:
62.32 ms | 403 KiB | 5 Q