3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ [ "id" => '6230061c0e88d709ca0d7bbc', 'name' => 'Mobile SamSung', 'slug' => 'mobile-samsung', 'createdAt' => '1648006346' ], [ "id" => '5d1eff529a426778d4b92383', 'name' => 'Mobile Iphone', 'slug' => 'mobile-iphone', 'createdAt' => '1647314181' ], [ "id" => '5d1eff6b9a426778d4b92dc4', 'name' => 'Mobile SamSung', 'slug' => 'mobile-samsung', 'createdAt' => '1647314460' ], [ "id" => '5f894011266aea580b028cb0', 'name' => 'Mobile LG', 'slug' => 'mobile-lg', 'createdAt' => '1647314456' ], [ "id" => '5f894011266aea580b028cb0', 'name' => 'Mobile LG', 'slug' => 'mobile-lg', 'createdAt' => '1647314458' ], [ "id" => '5f894011266aea580b028cb0', 'name' => 'Mobile LG', 'slug' => 'mobile-lg', 'createdAt' => '1647314457' ], ]; $newArray = []; foreach ($array as $key => $value) { $findIndex = array_search($value['slug'], array_column($newArray, 'slug')); if ($findIndex === false) { $newArray[] = $value; } elseif ($findIndex !== false && $newArray[$findIndex]['createdAt'] <= $value['createdAt']) { $newArray[$findIndex] = $value; } } print_r($newArray);

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.0050.00318.52
8.5.60.0090.00716.80
8.5.50.0090.00716.76
8.5.30.0120.00520.27
8.5.20.0110.00620.13
8.5.10.0080.00818.76
8.5.00.0120.01019.78
8.4.210.0130.00919.43
8.4.180.0120.01121.59
8.4.170.0120.00920.56
8.4.160.0120.00923.99
8.4.150.0070.00516.91
8.4.140.0110.00920.43
8.4.130.0120.00817.66
8.4.120.0110.00920.55
8.4.110.0090.01319.08
8.4.100.0140.00617.99
8.4.90.0110.00820.65
8.4.80.0110.00920.87
8.4.70.0050.00619.03
8.4.60.0100.01020.35
8.4.50.0050.00420.62
8.4.40.0060.01619.20
8.4.30.0170.00320.83
8.4.20.0120.00817.96
8.4.10.0100.01020.56
8.3.300.0130.00920.62
8.3.290.0110.01018.34
8.3.280.0120.00918.30
8.3.270.0110.00816.50
8.3.260.0150.00516.64
8.3.250.0050.00318.90
8.3.240.0130.00716.63
8.3.230.0100.01016.59
8.3.220.0120.00419.18
8.3.210.0130.00616.61
8.3.200.0040.00816.48
8.3.190.0090.00917.15
8.3.180.0090.00918.88
8.3.170.0140.00317.07
8.3.160.0140.00716.69
8.3.150.0150.00316.90
8.3.140.0030.00516.61
8.3.130.0080.00018.42
8.3.120.0080.00020.58
8.3.110.0030.00516.43
8.3.100.0070.01020.43
8.3.90.0050.00316.77
8.3.80.0090.00016.63
8.3.70.0100.00716.75
8.3.60.0060.00916.38
8.3.50.0060.00920.10
8.3.40.0100.00722.22
8.3.30.0080.00819.46
8.3.20.0050.00324.18
8.3.10.0030.00624.66
8.3.00.0040.00426.16
8.2.300.0100.01018.24
8.2.290.0080.01017.26
8.2.280.0040.00418.41
8.2.270.0140.00416.56
8.2.260.0120.00617.16
8.2.250.0030.00518.52
8.2.240.0100.00018.21
8.2.230.0060.00320.94
8.2.220.0060.00324.06
8.2.210.0110.00426.77
8.2.200.0080.00018.54
8.2.190.0070.00716.63
8.2.180.0070.00725.92
8.2.170.0070.01318.95
8.2.160.0070.00722.96
8.2.150.0000.00725.66
8.2.140.0000.00724.66
8.2.130.0090.00026.16
8.2.120.0080.00026.16
8.2.110.0000.00919.45
8.2.100.0000.01117.91
8.2.90.0000.00819.22
8.2.80.0000.00817.97
8.2.70.0030.00517.50
8.2.60.0070.00019.09
8.2.50.0050.00318.07
8.2.40.0000.00818.28
8.2.30.0040.00418.05
8.2.20.0000.00720.45
8.2.10.0000.00718.00
8.2.00.0040.00419.31
8.1.340.0100.01017.51
8.1.330.0130.00517.86
8.1.320.0100.00816.26
8.1.310.0100.00716.71
8.1.300.0090.00017.92
8.1.290.0060.00330.84
8.1.280.0110.00725.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0050.00519.48
8.1.230.0030.00720.96
8.1.220.0000.00917.74
8.1.210.0000.00818.77
8.1.200.0000.00917.23
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0080.00018.49
8.1.160.0040.00418.91
8.1.150.0040.00418.64
8.1.140.0040.00417.45
8.1.130.0030.00318.96
8.1.120.0000.00717.45
8.1.110.0050.00317.47
8.1.100.0070.00017.38
8.1.90.0040.00417.45
8.1.80.0000.00917.46
8.1.70.0000.00717.35
8.1.60.0040.00417.57
8.1.50.0060.00317.53
8.1.40.0070.00317.51
8.1.30.0040.01117.64
8.1.20.0070.00717.58
8.1.10.0080.00417.43
8.1.00.0030.00917.38
8.0.300.0040.00418.77
8.0.290.0000.00816.63
8.0.280.0030.00318.43
8.0.270.0030.00316.83
8.0.260.0060.00018.55
8.0.250.0030.00316.99
8.0.240.0000.00716.85
8.0.230.0040.00416.84
8.0.220.0000.00716.91
8.0.210.0030.00316.94
8.0.200.0000.00716.85
8.0.190.0030.00316.93
8.0.180.0040.00416.80
8.0.170.0080.00316.92
8.0.160.0050.00316.90
8.0.150.0070.00316.65
8.0.140.0040.00416.71
8.0.130.0110.00316.81
8.0.120.0050.01016.77
8.0.110.0060.00616.85
8.0.100.0110.00716.68
8.0.90.0120.00516.69
8.0.80.0060.01216.84
8.0.70.0130.01016.75
8.0.60.0210.00916.83
8.0.50.0150.00616.73
8.0.30.0140.01116.90
8.0.20.0180.00516.75
8.0.10.0130.00417.00
7.4.330.0020.00215.55
7.4.320.0000.00616.50
7.4.300.0000.00616.43
7.4.290.0040.00416.51
7.4.280.0190.00316.48
7.4.270.0160.00416.57
7.4.260.0130.00316.57
7.4.250.0110.00216.54
7.4.240.0090.00016.50
7.4.230.0090.00016.50
7.4.220.0140.00016.35
7.4.210.0000.01016.60
7.4.200.0040.00416.54
7.4.190.0070.00416.56
7.4.180.0040.00916.56
7.4.160.0030.00516.46
7.4.150.0080.00416.22
7.4.140.0100.00516.48
7.4.130.0170.00016.32
7.4.120.0170.00016.34
7.4.110.0090.00416.34
7.4.100.0090.00316.24
7.4.90.0060.00616.12
7.4.80.0100.00316.00
7.4.70.0050.01016.53
7.4.60.0060.00616.35
7.4.50.0130.00016.14
7.4.40.0080.00516.27
7.4.30.0060.00316.44
7.4.20.0000.00716.34
7.4.10.0000.00716.34
7.4.00.0070.00016.34

preferences:
43.32 ms | 1358 KiB | 5 Q