3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'key_1' => 'FOO', 'key_2' => 'FTU-1', 'cats' => '/30/' ], [ 'key_1' => 'FOO', 'key_2' => 'FTU-2', 'cats' => '/30/' ], [ 'key_1' => 'FOO', 'key_2' => 'FTU-3', 'cats' => '/30/10/' ], [ 'key_1' => 'FOO', 'key_2' => 'FTU-4', 'cats' => '/15/' ], [ 'key_1' => 'FOO', 'key_2' => 'FTU-5', 'cats' => '/10/' ], [ 'key_1' => 'FOO', 'key_2' => 'FTU-6', 'cats' => '/15/' ], ]; $result = []; foreach ($array as $row) { $cats = preg_split('#/#', $row['cats'], 0, PREG_SPLIT_NO_EMPTY); foreach ($cats as $cat) { $result[$cat][] = $row; } } var_export($result);

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.0110.00816.82
8.5.00.0110.01320.16
8.4.150.0010.00114.05
8.4.140.0110.01117.61
8.4.130.0130.00717.94
8.4.120.0130.00720.35
8.4.110.0130.00822.65
8.4.100.0050.00417.95
8.4.90.0080.01218.86
8.4.80.0100.01019.75
8.4.70.0070.00217.95
8.4.60.0100.01018.85
8.4.50.0090.01018.61
8.4.40.0130.00717.62
8.4.30.0120.00620.48
8.4.20.0070.01019.63
8.4.10.0050.00319.69
8.3.280.0150.00618.43
8.3.270.0120.00916.76
8.3.260.0030.00616.85
8.3.250.0060.00319.00
8.3.240.0100.00916.77
8.3.230.0100.00616.91
8.3.220.0100.01017.28
8.3.210.0130.00618.43
8.3.200.0040.00516.80
8.3.190.0120.00617.22
8.3.180.0120.00716.53
8.3.170.0040.01517.15
8.3.160.0150.00420.88
8.3.150.0200.00017.27
8.3.140.0060.00916.86
8.3.130.0110.00317.78
8.3.120.0150.01017.61
8.3.110.0120.00817.73
8.3.100.0170.00616.67
8.3.90.0150.00816.80
8.3.80.0200.00317.49
8.3.70.0260.00016.59
8.3.60.0220.00316.77
8.3.50.0240.00217.39
8.3.40.0150.00717.68
8.3.30.0160.00417.46
8.3.20.0170.00418.44
8.3.10.0140.00517.48
8.3.00.0130.00218.38
8.2.290.0070.01120.72
8.2.280.0110.00618.68
8.2.270.0110.00716.48
8.2.260.0150.00317.29
8.2.250.0130.00717.67
8.2.240.0140.00716.81
8.2.230.0120.00816.49
8.2.220.0170.00316.76
8.2.210.0140.00616.50
8.2.200.0160.00516.40
8.2.190.0140.00717.22
8.2.180.0160.00316.46
8.2.170.0220.00217.65
8.2.160.0190.00317.56
8.2.150.0170.00417.70
8.2.140.0130.00817.56
8.2.130.0170.00518.28
8.2.120.0160.00517.54
8.2.110.0170.00518.42
8.2.100.0140.00617.53
8.2.90.0180.00217.74
8.2.80.0140.00517.43
8.2.70.0170.00318.46
8.2.60.0120.00418.34
8.2.50.0190.00117.53
8.2.40.0150.00417.69
8.2.30.0140.00517.45
8.2.20.0180.00117.42
8.2.10.0160.00417.45
8.2.00.0160.00317.43
8.1.330.0090.01022.04
8.1.320.0100.00916.23
8.1.310.0000.00816.54
8.1.300.0100.01016.21
8.1.290.0140.00617.20
8.1.280.0140.00516.34
8.1.270.0160.00617.33
8.1.260.0150.00617.49
8.1.250.0130.00717.55
8.1.240.0160.00318.39
8.1.230.0110.00817.56
8.1.220.0100.00817.27
8.1.210.0190.00117.21
8.1.200.0180.00117.19
8.1.190.0100.00717.22
8.1.180.0140.00417.14
8.1.170.0150.00317.13
8.1.160.0140.00518.12
8.1.150.0130.00517.26
8.1.140.0150.00317.19
8.1.130.0170.00417.21
8.1.120.0150.00617.37
8.1.110.0100.00817.27
8.1.100.0190.00017.35
8.1.90.0060.01217.22
8.1.80.0130.00617.23
8.1.70.0120.00617.30
8.1.60.0190.00117.35
8.1.50.0150.00517.25
8.1.40.0160.00317.33
8.1.30.0140.00717.53
8.1.20.0120.00917.55
8.1.10.0200.00217.23
8.1.00.0150.00517.21

preferences:
77.47 ms | 403 KiB | 5 Q