3v4l.org

run code in 500+ PHP versions simultaneously
<?php $data = [ 0 => [ 'order' => 3, 'userId' => 'b3cef82a-ab65-4a0f-9e4b-3ad1d0324532', 'createdAt' => '2021-09-24T03:29:37.000Z', 'updatedAt' => '2021-09-24T03:29:37.000Z', ], 1 => [ 'order' => 2, 'userId' => '2955e28b-4d26-4992-9b5e-b300529dsas3', 'createdAt' => '2021-09-24T03:22:32.000Z', 'updatedAt' => '2021-09-24T03:22:32.000Z', ], 2 => [ 'order' => 3, 'userId' => 'wert5678-b85c-4802-b53f-cbdfe9515ty6b', 'createdAt' => '2021-09-01T10:13:45.000Z', 'updatedAt' => '2021-09-01T10:13:45.000Z', ], ]; $dataReal = null; foreach ($data as $v) { if( $v['order'] == 3 && // check for order ( $dataReal === null || // dataReal is empty strtotime($dataReal['createdAt']) < strtotime($v['createdAt']) // override if date is newer ) ) { $dataReal = $v; } } print_r($dataReal);

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.70.0110.00317.11
8.5.60.0090.01017.29
8.5.50.0060.00117.00
8.5.30.0070.00317.50
8.5.20.0070.00919.82
8.5.10.0130.00517.05
8.5.00.0140.00820.31
8.4.210.0050.00519.74
8.4.180.0100.01220.05
8.4.170.0120.01020.74
8.4.160.0090.01424.11
8.4.150.0080.00516.98
8.4.140.0150.00618.20
8.4.130.0040.00518.32
8.4.120.0090.01020.62
8.4.110.0050.01219.19
8.4.100.0160.00417.84
8.4.90.0100.00818.02
8.4.80.0060.00218.53
8.4.70.0120.00918.50
8.4.60.0120.01020.68
8.4.50.0140.00518.30
8.4.40.0060.01618.23
8.4.30.0050.00320.71
8.4.20.0050.00320.06
8.4.10.0130.00718.42
8.3.300.0110.00921.01
8.3.290.0140.00720.91
8.3.280.0110.01018.82
8.3.270.0080.01316.83
8.3.260.0060.00417.09
8.3.250.0100.00819.12
8.3.240.0110.01016.95
8.3.230.0130.00717.00
8.3.220.0080.01117.41
8.3.210.0080.00617.07
8.3.200.0050.00317.04
8.3.190.0080.00717.45
8.3.180.0100.00922.91
8.3.170.0130.00717.26
8.3.160.0090.00919.25
8.3.150.0100.01016.76
8.3.140.0070.00717.04
8.3.130.0040.00418.94
8.3.120.0130.00719.15
8.3.110.0030.00820.94
8.3.100.0030.00624.06
8.3.90.0050.00326.77
8.3.80.0030.00617.13
8.3.70.0040.01118.52
8.3.60.0100.00616.88
8.3.50.0140.00018.48
8.3.40.0140.00720.72
8.3.30.0060.00919.11
8.3.20.0080.00024.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.300.0120.01022.43
8.2.290.0120.00819.05
8.2.280.0080.01018.82
8.2.270.0040.01518.80
8.2.260.0030.00517.62
8.2.250.0040.00717.10
8.2.240.0050.00519.01
8.2.230.0000.00822.58
8.2.220.0060.00337.54
8.2.210.0130.00626.77
8.2.200.0030.00618.54
8.2.190.0180.00017.00
8.2.180.0100.01025.92
8.2.170.0120.00322.96
8.2.160.0030.01022.96
8.2.150.0030.00525.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0080.00021.11
8.2.110.0030.00619.58
8.2.100.0060.00619.85
8.2.90.0060.00318.25
8.2.80.0030.00619.17
8.2.70.0050.00317.98
8.2.60.0040.00418.13
8.2.50.0000.00818.40
8.2.40.0050.00517.96
8.2.30.0060.00618.23
8.2.20.0040.00418.40
8.2.10.0050.00518.80
8.2.00.0030.01018.91
8.1.340.0130.00919.64
8.1.330.0040.00316.37
8.1.320.0090.01116.54
8.1.310.0050.00218.73
8.1.300.0120.00318.41
8.1.290.0060.00330.84
8.1.280.0070.00725.92
8.1.270.0040.00423.99
8.1.260.0060.00326.35
8.1.250.0000.00828.09
8.1.240.0030.00619.82
8.1.230.0040.00718.07
8.1.220.0000.00818.16
8.1.210.0040.00418.77
8.1.200.0000.01017.73
8.1.190.0080.00017.73
8.1.180.0050.00318.10
8.1.170.0000.00717.77
8.1.160.0100.00218.62
8.1.150.0060.00518.40
8.1.140.0040.00817.83
8.1.130.0030.01017.87
8.1.120.0070.00517.90
8.1.110.0100.00317.88
8.1.100.0080.00417.96
8.1.90.0080.00417.88
8.1.80.0070.00717.92
8.1.70.0020.01117.74
8.1.60.0070.00917.99
8.1.50.0080.00717.79
8.1.40.0070.00717.88
8.1.30.0090.00717.97
8.1.20.0080.00717.98
8.1.10.0120.00517.83
8.1.00.0120.00217.87
8.0.300.0000.00818.77
8.0.290.0080.00017.25
8.0.280.0050.00618.00
8.0.270.0050.00517.25
8.0.260.0040.00617.19
8.0.250.0050.00517.32
8.0.240.0070.00517.29
8.0.230.0070.00417.35
8.0.220.0050.00617.33
8.0.210.0090.00317.23
8.0.200.0090.00417.33
8.0.190.0110.00217.34
8.0.180.0110.00317.36
8.0.170.0090.00417.29
8.0.160.0120.00217.29
8.0.150.0080.00617.27
8.0.140.0100.00317.32
8.0.130.0080.00416.07
8.0.120.0090.00317.29
8.0.110.0120.00117.24
8.0.100.0100.00217.14
8.0.90.0100.00317.30
8.0.80.0060.00617.21
8.0.70.0100.00217.25
8.0.60.0110.00317.28
8.0.50.0100.00217.28
8.0.30.0100.00417.34
8.0.20.0090.00417.29
8.0.10.0080.00617.42
8.0.00.0100.00317.41
7.4.330.0000.00715.60
7.4.320.0070.00316.99
7.4.300.0110.00216.87
7.4.290.0110.00316.87
7.4.280.0060.00816.87
7.4.270.0120.00216.91
7.4.260.0080.00515.83
7.4.250.0100.00516.90
7.4.240.0090.00416.76
7.4.230.0100.00316.98
7.4.220.0050.00716.83
7.4.210.0080.00316.80
7.4.200.0080.00416.75
7.4.190.0060.00617.03
7.4.180.0070.00616.93
7.4.160.0110.00116.94
7.4.150.0070.00416.90
7.4.140.0080.00516.68
7.4.130.0070.00516.77
7.4.120.0060.00616.75
7.4.110.0050.00616.85
7.4.100.0090.00216.80
7.4.90.0070.00416.61
7.4.80.0060.00516.84
7.4.70.0080.00316.76
7.4.60.0060.00516.86
7.4.50.0060.00416.67
7.4.40.0050.00616.66
7.4.30.0070.00316.67
7.4.20.0050.00616.70
7.4.10.0090.00216.77
7.4.00.0110.00116.81
7.3.330.0090.00516.64
7.3.320.0060.00615.67
7.3.310.0060.00616.62
7.3.300.0080.00416.63
7.3.290.0050.00716.68
7.3.280.0090.00316.67
7.3.270.0080.00516.67
7.3.260.0080.00216.67
7.3.250.0070.00616.69
7.3.240.0080.00416.68
7.3.230.0090.00216.64
7.3.220.0040.00916.67
7.3.210.0070.00516.65
7.3.200.0090.00316.65
7.3.190.0090.00416.68
7.3.180.0050.00716.68
7.3.170.0080.00416.66
7.3.160.0070.00416.60
7.3.150.0120.00016.67
7.3.140.0070.00516.67
7.3.130.0070.00516.68
7.3.120.0070.00516.61
7.3.110.0040.00916.61
7.3.100.0060.00616.53
7.3.90.0080.00516.88
7.3.80.0070.00516.61
7.3.70.0060.00616.74
7.3.60.0070.00416.82
7.3.50.0060.00616.77
7.3.40.0070.00516.81
7.3.30.0060.00616.72
7.3.20.0090.00418.63
7.3.10.0070.00618.58
7.3.00.0110.00218.60

preferences:
62.77 ms | 1429 KiB | 5 Q