3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['action' => 'Created', 'timestamp' => '2023-10-30 20:51:57.284602'], ['action' => 'Updated', 'timestamp' => '2023-10-30 20:51:57.284603'], ['action' => 'Started', 'timestamp' => '2023-10-30 20:51:57.284604'], ['action' => 'Bid placed', 'timestamp' => '2023-10-30 20:51:57.284605'], ['action' => 'Bid placed', 'timestamp' => '2023-10-30 20:51:57.284606'], ['action' => 'Max bid placed', 'timestamp' => '2023-10-30 20:51:57.284607'], ['action' => 'Bid placed', 'timestamp' => '2023-10-30 20:51:57.284608'], ['action' => 'Had a nap', 'timestamp' => '2023-10-30 20:51:57.284609'], //['action' => 'Max bid placed', 'timestamp' => '2023-10-30 20:51:57.284610'], ['action' => 'Bid placed', 'timestamp' => '2023-10-30 20:51:57.284611'], ['action' => 'Max bid placed', 'timestamp' => '2023-10-30 20:51:57.284612'], ['action' => 'Ended', 'timestamp' => '2023-10-30 20:51:57.284613'], ]; $start = null; foreach ($array as $i => $row) { if ($row['action'] === 'Bid placed') { $start ??= $i; // only store the first $i in the group continue; } if ($start !== null && $row['action'] === 'Max bid placed') { array_splice($array, $start, 0, array_splice($array, $i, 1)); // prune and reinsert row } $start = null; } var_export($array);

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.0120.00517.80
8.4.120.0080.00820.74
8.4.110.0100.01022.31
8.4.100.0120.00817.78
8.4.90.0160.00517.73
8.4.80.0150.00517.75
8.4.70.0110.00717.91
8.4.60.0160.00617.75
8.4.50.0110.01117.87
8.4.40.0090.00918.68
8.4.30.0070.01122.54
8.4.20.0070.01417.82
8.4.10.0030.00619.40
8.3.250.0140.00518.84
8.3.240.0100.00816.77
8.3.230.0120.00816.59
8.3.220.0030.00417.30
8.3.210.0040.00416.61
8.3.200.0090.01016.59
8.3.190.0090.00619.18
8.3.180.0060.00216.55
8.3.170.0130.00320.82
8.3.160.0090.00616.63
8.3.150.0080.00019.02
8.3.140.0000.00817.36
8.3.130.0070.00718.46
8.3.120.0090.00019.10
8.3.110.0060.00920.94
8.3.100.0060.00624.06
8.3.90.0030.00526.77
8.3.80.0100.00317.97
8.3.70.0130.00918.30
8.3.60.0070.01416.75
8.3.50.0120.00316.62
8.3.40.0130.00722.05
8.3.30.0090.00621.75
8.3.20.0070.00024.18
8.3.10.0060.00324.66
8.3.00.0050.00326.16
8.2.290.0100.00920.54
8.2.280.0080.01118.39
8.2.270.0110.00717.00
8.2.260.0050.00318.40
8.2.250.0090.01216.56
8.2.240.0080.00019.07
8.2.230.0070.00422.58
8.2.220.0030.00637.54
8.2.210.0070.00726.77
8.2.200.0060.00316.50
8.2.190.0040.01118.08
8.2.180.0140.00716.88
8.2.170.0040.01518.91
8.2.160.0110.00422.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0070.00026.16
8.2.120.0000.00719.95
8.2.110.0050.00520.39
8.2.100.0120.01219.13
8.2.90.0250.00918.98
8.2.80.0230.00818.72
8.2.70.0230.00718.68
8.2.60.0170.00318.70
8.2.50.0330.01018.91
8.2.40.0180.01418.81
8.2.30.0270.00318.79
8.2.20.0270.00718.70
8.2.10.0260.00319.03
8.2.00.0190.01518.93
8.1.330.0130.00822.00
8.1.320.0150.00715.98
8.1.310.0110.00716.88
8.1.300.0030.01317.83
8.1.290.0030.00630.84
8.1.280.0040.01125.92
8.1.270.0000.00823.99
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0170.01718.44
8.1.230.0160.00918.69
8.1.220.0080.00818.48
8.1.210.0200.01319.87
8.1.200.0170.01018.50
8.1.190.0190.01218.25
8.1.180.0170.00318.33
8.1.170.0190.00718.49
8.1.160.0050.01118.86
8.1.150.0200.00920.40
8.1.140.0140.01418.33
8.1.130.0190.01118.65
8.1.120.0210.01118.61
8.1.110.0130.00918.73
8.1.100.0130.01018.39
8.1.90.0160.00618.55
8.1.80.0120.00418.61
8.1.70.0140.00018.67
8.1.60.0120.00618.80
8.1.50.0120.00618.58
8.1.40.0150.00018.92
8.1.30.0120.00318.69
8.1.20.0120.00618.77
8.1.10.0150.00018.67
8.1.00.0050.01418.52
8.0.300.0230.01317.70
8.0.290.0190.00017.81
8.0.280.0150.00017.82
8.0.270.0110.00517.82
8.0.260.0160.01017.79
8.0.250.0180.00717.82
8.0.240.0200.01617.92
8.0.230.0250.00318.06
8.0.220.0350.00417.81
8.0.210.0180.00017.71
8.0.200.0200.00017.79
8.0.190.0170.00917.65
8.0.180.0220.01317.84
8.0.170.0060.00817.93
8.0.160.0200.00317.80
8.0.150.0250.00417.75
8.0.140.0180.00717.83
8.0.130.0180.00618.32
8.0.120.0340.00317.83
8.0.110.0300.00717.80
8.0.100.0320.00617.66
8.0.90.0210.01217.73
8.0.80.0230.00617.63
8.0.70.0080.00817.83
8.0.60.0290.00617.88
8.0.50.0200.00317.87
8.0.30.0100.00317.93
8.0.20.0150.00317.86
8.0.10.0220.00317.82

preferences:
29.51 ms | 403 KiB | 5 Q