3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_export(preg_split('~.{3}\K~', 'abcdefghijklm', 3)); echo "\n---\n"; var_export([preg_replace('~.{3}\K~','*', 'abcdefghijklm', 3, $count1), $count1]); echo "\n---\n"; var_export([preg_filter('~.{3}\K~', '*', 'abcdefghijklm', 3, $count2), $count2]); echo "\n---\n"; var_export(preg_grep('~.{3}\K~', ['abcdef', 'ghijklm'])); echo "\n---\n"; var_export(preg_match_all('~(.{3})\K~', 'abcdefghijklm', $m1) ? $m1 : null); echo "\n---\n"; var_export(preg_match_all('~.{3}\K~', 'abcdefghijklm', $m2) ? $m2 : null); echo "\n---\n"; var_export([preg_replace_callback('~.{3}\K~', function() { return '*'; }, 'abcdefghijklm', 3, $count3), $count3]);

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.60.0110.00416.63
8.3.50.0070.01118.38
8.3.40.0030.01719.01
8.3.30.0060.00918.88
8.3.20.0000.00824.18
8.3.10.0060.00324.66
8.3.00.0080.00026.16
8.2.180.0130.00325.92
8.2.170.0140.00719.08
8.2.160.0110.01122.96
8.2.150.0040.00425.66
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0120.00326.16
8.2.110.0030.00622.41
8.2.100.0090.00318.03
8.2.90.0080.00018.03
8.2.80.0050.00319.02
8.2.70.0080.00017.75
8.2.60.0030.00617.92
8.2.50.0000.00918.07
8.2.40.0040.00420.19
8.2.30.0040.00418.02
8.2.20.0000.00718.13
8.2.10.0070.00019.30
8.2.00.0040.00419.22
8.1.280.0070.00725.92
8.1.270.0040.00423.99
8.1.260.0070.00226.35
8.1.250.0000.00828.09
8.1.240.0000.00920.77
8.1.230.0000.01121.03
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0060.00317.47
8.1.190.0000.00817.35
8.1.180.0000.00818.10
8.1.170.0060.00318.63
8.1.160.0050.00318.78
8.1.150.0040.00418.87
8.1.140.0040.00418.74
8.1.130.0030.00320.19
8.1.120.0040.00417.48
8.1.110.0040.00417.44
8.1.100.0040.00417.42
8.1.90.0040.00417.47
8.1.80.0060.00617.57
8.1.70.0050.00217.58
8.1.60.0040.00417.65
8.1.50.0040.00417.52
8.1.40.0080.00017.63
8.1.30.0000.00817.75
8.1.20.0030.00517.72
8.1.10.0040.00417.64
8.1.00.0050.00517.62
8.0.300.0070.00020.16
8.0.290.0000.00916.75
8.0.280.0000.00718.43
8.0.270.0070.00018.17
8.0.260.0070.00018.42
8.0.250.0040.00416.96
8.0.240.0000.00717.00
8.0.230.0040.00417.00
8.0.220.0030.00316.95
8.0.210.0000.00716.93
8.0.200.0070.00017.12
8.0.190.0030.00517.00
8.0.180.0040.00417.08
8.0.170.0050.00317.09
8.0.160.0040.00416.94
8.0.150.0060.00316.96
8.0.140.0070.00017.03
8.0.130.0000.00613.55
8.0.120.0030.00717.00
8.0.110.0040.00416.99
8.0.100.0070.00017.13
8.0.90.0030.00517.00
8.0.80.0080.01017.05
8.0.70.0050.00317.01
8.0.60.0070.00017.17
8.0.50.0000.00717.08
8.0.30.0030.01217.11
8.0.20.0090.01117.10
8.0.10.0040.01117.11
8.0.00.0060.00917.18
7.4.330.0050.00015.55
7.4.320.0030.00316.71
7.4.300.0040.00416.68
7.4.290.0040.00416.62
7.4.280.0060.00316.71
7.4.270.0000.00716.75
7.4.260.0050.00013.43
7.4.250.0080.00016.62
7.4.240.0030.00316.58
7.4.230.0000.00716.79
7.4.220.0000.00716.57
7.4.210.0070.00716.74
7.4.200.0000.00716.88
7.4.160.0110.00416.93
7.4.150.0100.01016.71
7.4.140.0110.00316.71
7.4.130.0110.00316.63
7.4.120.0070.00716.68
7.4.110.0030.01116.72
7.4.100.0140.00016.75
7.4.90.0060.00916.80
7.4.80.0060.00916.66
7.4.70.0070.00716.71
7.4.60.0070.00716.68
7.4.50.0090.00616.56
7.4.40.0100.00416.52
7.4.30.0080.00516.62
7.4.20.0070.00716.55
7.4.10.0070.00716.56
7.4.00.0090.00616.80
7.3.330.0000.00616.61
7.3.320.0050.00013.53
7.3.310.0040.00416.63
7.3.300.0070.00016.42
7.3.290.0080.00816.50
7.3.270.0030.01016.45
7.3.260.0060.01016.44
7.3.250.0050.00816.52
7.3.240.0040.01016.64
7.3.230.0130.00316.57
7.3.220.0040.01116.41
7.3.210.0070.00716.31
7.3.200.0100.00316.40
7.3.190.0060.00916.39
7.3.180.0130.00016.41
7.3.170.0000.01416.40
7.3.160.0070.00716.33
7.3.150.0030.01016.41
7.3.140.0070.00716.37
7.3.130.0040.00916.40
7.3.120.0030.01016.36
7.3.110.0090.00516.32
7.3.100.0030.01016.33
7.3.90.0060.00616.74
7.3.80.0090.00516.40
7.3.70.0100.00316.56
7.3.60.0070.00716.60
7.3.50.0030.01016.52
7.3.40.0130.00016.62
7.3.30.0030.01016.61
7.3.20.0090.00416.64
7.3.10.0000.01316.59
7.3.00.0080.00616.54

preferences:
64.47 ms | 401 KiB | 5 Q