3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( array( 'foo' => 1, 'bar' => 2, 'thing' => 'apple' ), array( 'foo' => 1, 'bar' => 2, 'thing' => 'orange' ), array( 'foo' => 2, 'bar' => 2, 'thing' => 'apple' ), ); $newArr = $keys = array(); function filterArr($row) { global $newArr, $keys; if (isset($keys[$row['foo']][$row['bar']])) { $newArr[$keys[$row['foo']][$row['bar']]]['thing'][] = $row['thing']; } else { $keys[$row['foo']][$row['bar']] = array_push($newArr, $row) - 1; $newArr[$keys[$row['foo']][$row['bar']]]['thing'] = array($row['thing']); } } array_map('filterArr', $arr); print_r($newArr);

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.0080.00920.29
8.5.00.0120.00920.07
8.4.160.0120.01023.98
8.4.150.0020.00014.05
8.4.140.0150.01117.48
8.4.130.0120.00818.50
8.4.120.0150.00424.25
8.4.110.0100.01019.55
8.4.100.0100.01117.65
8.4.90.0040.00720.73
8.4.80.0130.00618.82
8.4.70.0110.00918.96
8.4.60.0160.00418.80
8.4.50.0120.00818.72
8.4.40.0060.00919.23
8.4.30.0000.02020.83
8.4.20.0180.00019.85
8.4.10.0150.00423.71
8.3.280.0060.00318.43
8.3.270.0100.01016.58
8.3.260.0000.00916.73
8.3.250.0130.00518.76
8.3.240.0060.00217.03
8.3.230.0150.00416.61
8.3.220.0100.00819.05
8.3.210.0050.00318.20
8.3.200.0050.00416.23
8.3.190.0020.00717.20
8.3.180.0130.00618.85
8.3.170.0120.00622.61
8.3.160.0090.00918.95
8.3.150.0130.00617.30
8.3.140.0070.01120.77
8.3.130.0070.00718.68
8.3.120.0060.00320.83
8.3.110.0040.00718.30
8.3.100.0100.00018.29
8.3.90.0050.00326.77
8.3.80.0080.00418.43
8.3.70.0090.00916.38
8.3.60.0060.00918.31
8.3.50.0070.00718.53
8.3.40.0140.00023.65
8.3.30.0040.01118.84
8.3.20.0000.00724.18
8.3.10.0040.00424.66
8.3.00.0040.00426.16
8.2.290.0060.00216.67
8.2.280.0130.00718.29
8.2.270.0110.00716.64
8.2.260.0040.00417.47
8.2.250.0030.00616.75
8.2.240.0110.00816.96
8.2.230.0050.00520.94
8.2.220.0040.00424.06
8.2.210.0030.00726.77
8.2.200.0030.01016.38
8.2.190.0070.00716.61
8.2.180.0100.01016.88
8.2.170.0120.00318.97
8.2.160.0000.02022.96
8.2.150.0040.00425.66
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0070.00026.16
8.2.110.0090.00020.45
8.2.100.0040.01117.72
8.2.90.0040.00417.63
8.2.80.0050.00318.59
8.2.70.0040.00417.75
8.2.60.0040.00417.50
8.2.50.0040.00418.00
8.2.40.0000.00818.16
8.2.30.0060.00617.88
8.2.20.0150.00217.73
8.2.10.0120.00817.76
8.2.00.0060.00617.81
8.1.330.0120.00816.09
8.1.320.0140.00517.83
8.1.310.0040.00416.51
8.1.300.0030.00619.66
8.1.290.0040.00430.84
8.1.280.0130.01025.92
8.1.270.0040.00424.66
8.1.260.0090.00026.35
8.1.250.0040.00428.09
8.1.240.0080.00421.99
8.1.230.0040.00822.63
8.1.220.0040.00418.52
8.1.210.0080.00018.77
8.1.200.0000.00817.35
8.1.190.0000.00817.35
8.1.180.0040.00418.10
8.1.170.0040.00417.62
8.1.160.0000.00817.49
8.1.150.0090.00617.48
8.1.140.0110.00417.53
8.1.130.0130.00317.55
8.1.120.0160.00017.45
8.1.110.0110.00617.50
8.1.100.0170.00017.45
8.1.90.0090.00617.34
8.1.80.0140.00317.54
8.1.70.0120.00617.46
8.1.60.0180.00317.71
8.1.50.0160.00317.59
8.1.40.0080.01117.68
8.1.30.0120.00317.60
8.1.20.0140.00317.67
8.1.10.0160.00217.69
8.1.00.0190.00017.66
8.0.300.0090.00018.77
8.0.290.0040.00416.75
8.0.280.0090.00416.77
8.0.270.0110.00416.86
8.0.260.0140.00016.73
8.0.250.0120.00316.94
8.0.240.0060.00616.90
8.0.230.0180.00016.86
8.0.220.0110.00516.73
8.0.210.0070.00716.74
8.0.200.0090.00316.81
8.0.190.0120.00316.87
8.0.180.0100.00516.82
8.0.170.0090.00616.89
8.0.160.0120.00316.82
8.0.150.0040.01216.81
8.0.140.0120.00316.79
8.0.130.0160.00016.88
8.0.120.0160.00016.89
8.0.110.0120.00416.77
8.0.100.0050.00916.77
8.0.90.0040.01116.73
8.0.80.0100.00516.75
8.0.70.0100.00516.85
8.0.60.0060.00916.79
8.0.50.0090.00216.84
8.0.30.0120.00316.77
8.0.20.0140.00216.81
8.0.10.0100.00517.00

preferences:
38.79 ms | 403 KiB | 5 Q