3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myarray = array( [ 'messageId' => '5ACE9D8841', 'sender' => 'john@doe.com', ], [ 'messageId' => '7EE67D8170', 'sender' => 'dan@doe.com', ], [ 'messageId' => '8095FD8836', 'sender' => 'cat@doe.com', ], [ 'messageId' => ['brokenId' => '8095FD8836'], 'sender' => 'cat@doe.com', ], [ 'status' => 'wrong row', ], [ 'messageId' => '7EE67D8170', 'dest' => 'mitch@doe.com', 'status' => 'sent', 'date' => '2021-02-01 11:06:55', ], ); $result = array_reduce($myarray, function($rows, $item){ if (array_key_exists('messageId', $item) && is_scalar($item['messageId'])) { $rows = array_replace_recursive($rows ?? [], [$item['messageId'] => $item]); } return $rows; }); $result = array_values($result); print_r($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.4.140.0140.00717.77
8.4.130.0060.00319.59
8.4.120.0140.00624.09
8.4.110.0140.00622.40
8.4.100.0120.00918.89
8.4.90.0050.00518.96
8.4.80.0070.00220.43
8.4.70.0110.00918.21
8.4.60.0040.00418.88
8.4.50.0130.00620.45
8.4.40.0110.00017.79
8.4.30.0060.00920.30
8.4.20.0100.01017.55
8.4.10.0000.00926.07
8.3.270.0140.00516.73
8.3.260.0130.00616.48
8.3.250.0100.00819.14
8.3.240.0120.00717.28
8.3.230.0140.00616.57
8.3.220.0110.00618.81
8.3.210.0040.00316.87
8.3.200.0060.00316.87
8.3.190.0100.01117.09
8.3.180.0130.00816.77
8.3.170.0000.01517.13
8.3.160.0120.00618.42
8.3.150.0120.00920.80
8.3.140.0140.00417.18
8.3.130.0060.00318.41
8.3.120.0070.00418.77
8.3.110.0060.00316.63
8.3.100.0060.00316.65
8.3.90.0140.00426.77
8.3.80.0090.00019.36
8.3.70.0150.00018.36
8.3.60.0110.01418.31
8.3.50.0130.00323.51
8.3.40.0110.00418.90
8.3.30.0070.00718.66
8.3.20.0080.00024.18
8.3.10.0000.00824.66
8.3.00.0050.00326.16
8.2.290.0080.00520.54
8.2.280.0090.00819.38
8.2.270.0140.00417.59
8.2.260.0040.00416.79
8.2.250.0080.00016.81
8.2.240.0090.00017.29
8.2.230.0070.00420.94
8.2.220.0040.00424.06
8.2.210.0000.00826.77
8.2.200.0060.00318.88
8.2.190.0120.00318.43
8.2.180.0150.00725.92
8.2.170.0070.01419.09
8.2.160.0100.01022.96
8.2.150.0080.00025.66
8.2.140.0000.00724.66
8.2.130.0090.00026.16
8.2.120.0040.00421.25
8.2.110.0110.01120.53
8.2.100.0040.00817.84
8.2.90.0000.00819.30
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0080.00018.03
8.2.50.0080.00018.07
8.2.40.0040.00418.22
8.2.30.0000.00818.11
8.2.20.0000.00918.15
8.2.10.0000.00719.33
8.2.00.0070.00019.20
8.1.330.0110.00821.85
8.1.320.0080.01116.22
8.1.310.0100.00716.85
8.1.300.0090.00018.41
8.1.290.0090.00030.84
8.1.280.0140.00325.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00319.28
8.1.230.0080.00319.07
8.1.220.0040.00417.77
8.1.210.0000.00818.77
8.1.200.0000.00917.35
8.1.190.0050.00317.22
8.1.180.0040.00418.10
8.1.170.0040.00418.78
8.1.160.0000.00718.81
8.1.150.0070.00018.90
8.1.140.0070.00018.96
8.1.130.0030.00320.12
8.1.120.0000.00817.54
8.1.110.0060.00317.35
8.1.100.0000.00717.53
8.1.90.0000.00717.38
8.1.80.0050.00317.49
8.1.70.0040.00417.49
8.1.60.0070.00317.54
8.1.50.0050.00317.48
8.1.40.0040.00417.52
8.1.30.0000.00817.65
8.1.20.0000.00817.59
8.1.10.0000.01017.59
8.1.00.0000.00817.60
8.0.300.0070.00018.77
8.0.290.0030.00616.75
8.0.280.0000.00718.46
8.0.270.0000.00817.89
8.0.260.0060.00018.36
8.0.250.0000.00716.96
8.0.240.0030.00516.93
8.0.230.0000.00716.94
8.0.220.0000.00816.84
8.0.210.0070.00016.94
8.0.200.0040.00416.93
8.0.190.0000.00817.02
8.0.180.0070.00016.91
8.0.170.0030.00616.80
8.0.160.0070.00016.95
8.0.150.0040.00416.72
8.0.140.0070.00016.95
8.0.130.0000.00613.26
8.0.120.0050.00516.75
8.0.110.0000.00716.93
8.0.100.0000.00716.79
8.0.90.0000.00716.73
8.0.80.0120.00316.91
8.0.70.0000.00716.84
8.0.60.0000.00716.73
8.0.50.0050.00316.90
8.0.30.0150.00517.16
8.0.20.0120.00617.40
8.0.10.0120.00617.40
8.0.00.0090.00917.40
7.4.330.0000.00516.89
7.4.320.0030.00316.54
7.4.300.0060.00016.63
7.4.290.0080.00416.45
7.4.280.0070.00016.55
7.4.270.0040.00416.50
7.4.260.0050.00013.21
7.4.250.0030.00516.46
7.4.240.0040.00416.56
7.4.230.0030.00316.45
7.4.220.0000.00716.47
7.4.210.0070.00816.53
7.4.200.0030.00316.63
7.4.150.0060.01317.40
7.4.140.0120.00617.40
7.4.130.0030.01317.40
7.4.120.0110.00817.40
7.4.110.0070.01017.40
7.4.100.0170.02317.40
7.4.90.0090.00917.40
7.4.80.0090.00917.40
7.4.70.0090.01317.40
7.4.60.0110.01117.40
7.4.50.0040.01717.40
7.4.40.0030.01817.40
7.4.30.0080.01417.40
7.4.20.0100.00717.40
7.4.10.0060.01117.40
7.4.00.0070.01117.40
7.3.330.0030.00316.34
7.3.320.0000.00513.19
7.3.310.0070.00016.35
7.3.300.0070.00016.34
7.3.290.0080.01016.35
7.3.270.0090.00917.40
7.3.260.0100.00717.40
7.3.250.0060.01217.40
7.3.240.0040.01417.40
7.3.230.0070.01017.40
7.3.220.0080.00817.40
7.3.210.0050.01217.40
7.3.200.0110.00717.40
7.3.190.0040.01817.40
7.3.180.0060.01517.40
7.3.170.0190.00317.40
7.3.160.0120.00917.40
7.3.150.0100.00717.40
7.3.140.0160.00317.40
7.3.130.0060.01217.40
7.3.120.0130.00517.40
7.3.110.0130.00317.40
7.3.100.0080.00817.40
7.3.90.0030.01317.40
7.3.80.0100.00617.40
7.3.70.0060.01117.40
7.3.60.0060.01217.40
7.3.50.0110.00717.40
7.3.40.0080.01117.40
7.3.30.0080.00817.40
7.3.20.2040.00617.40
7.3.10.0120.00617.40
7.3.00.0120.00617.40

preferences:
39.79 ms | 403 KiB | 5 Q