3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ (object) ['ID' => 113, 'title' => 'text'], (object) ['ID' => 114, 'title' => 'text text text'], (object) ['ID' => 115, 'title' => 'text text'], (object) ['ID' => 116, 'title' => 'text'], ]; $result = []; foreach ($array as $obj) { $clone = clone $obj; unset($clone->ID); $result[$obj->ID] = $clone; } var_export($result); echo "\n---\n"; 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.5.30.0110.00819.40
8.5.20.0140.00419.41
8.5.10.0100.00820.04
8.5.00.0120.00919.90
8.4.180.0150.00919.77
8.4.170.0120.01120.65
8.4.160.0100.01123.86
8.4.150.0020.00114.05
8.4.140.0130.00917.79
8.4.130.0140.00718.67
8.4.120.0130.00724.32
8.4.110.0100.01020.75
8.4.100.0070.00417.82
8.4.90.0080.01019.03
8.4.80.0120.00719.50
8.4.70.0120.01017.90
8.4.60.0110.01018.75
8.4.50.0100.00620.60
8.4.40.0190.00019.69
8.4.30.0040.00420.55
8.4.20.0030.01719.35
8.4.10.0080.00024.05
8.3.300.0130.00720.74
8.3.290.0130.00720.88
8.3.280.0160.01018.54
8.3.270.0150.00516.55
8.3.260.0110.00816.92
8.3.250.0050.00219.05
8.3.240.0120.00717.04
8.3.230.0060.00216.72
8.3.220.0060.00717.14
8.3.210.0130.00716.76
8.3.200.0060.00316.62
8.3.190.0090.00717.12
8.3.180.0090.00918.43
8.3.170.0130.00617.10
8.3.160.0080.00018.39
8.3.150.0110.01118.97
8.3.140.0080.00017.25
8.3.130.0120.00318.26
8.3.120.0030.00618.78
8.3.110.0060.00316.64
8.3.100.0100.00024.06
8.3.90.0070.00726.77
8.3.80.0060.00318.43
8.3.70.0140.00716.75
8.3.60.0100.01018.16
8.3.50.0040.01418.17
8.3.40.0060.00820.39
8.3.30.0070.00718.84
8.3.20.0020.00524.18
8.3.10.0020.00524.66
8.3.00.0070.00026.16
8.2.300.0140.01022.20
8.2.290.0110.00520.36
8.2.280.0070.00818.36
8.2.270.0160.00318.93
8.2.260.0120.00316.79
8.2.250.0030.00616.61
8.2.240.0040.00418.96
8.2.230.0160.00320.94
8.2.220.0080.00037.54
8.2.210.0080.00026.77
8.2.200.0000.00916.75
8.2.190.0030.01216.75
8.2.180.0070.00725.92
8.2.170.0170.00318.91
8.2.160.0100.00322.96
8.2.150.0040.00425.66
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00026.16
8.2.110.0000.01022.29
8.2.100.0040.00718.03
8.2.90.0080.00020.60
8.2.80.0040.00417.75
8.2.70.0040.00417.75
8.2.60.0050.00318.05
8.2.50.0080.00018.07
8.2.40.0000.00919.95
8.2.30.0100.00018.11
8.2.20.0000.00719.23
8.2.10.0050.00218.07
8.2.00.0000.00719.29
8.1.340.0130.00719.55
8.1.330.0100.00722.13
8.1.320.0120.00816.32
8.1.310.0120.00618.42
8.1.300.0080.00017.76
8.1.290.0060.00330.84
8.1.280.0190.00025.92
8.1.270.0070.00024.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0130.00320.78
8.1.230.0080.00422.70
8.1.220.0000.00817.74
8.1.210.0030.00718.92
8.1.200.0030.00617.23
8.1.190.0080.00017.35
8.1.180.0050.00318.10
8.1.170.0040.00418.72
8.1.160.0040.00418.77
8.1.150.0050.00218.51
8.1.140.0050.00217.45
8.1.130.0030.00817.44
8.1.120.0120.00517.57
8.1.110.0140.00317.49
8.1.100.0070.01017.43
8.1.90.0120.00417.47
8.1.80.0170.00317.37
8.1.70.0110.00817.51
8.1.60.0100.00717.55
8.1.50.0110.00517.45
8.1.40.0140.00417.51
8.1.30.0100.00817.60
8.1.20.0180.00017.55
8.1.10.0070.01017.57
8.1.00.0130.00517.48
8.0.300.0030.00619.96
8.0.290.0040.00416.61
8.0.280.0070.00318.36
8.0.270.0070.00017.17
8.0.260.0150.00016.83
8.0.250.0180.00016.93
8.0.240.0120.00317.00
8.0.230.0150.00016.90
8.0.220.0100.00516.84
8.0.210.0030.00716.77
8.0.200.0070.00316.88
8.0.190.0130.00016.85
8.0.180.0130.00316.90
8.0.170.0090.00616.95
8.0.160.0150.00016.97
8.0.150.0060.00616.85
8.0.140.0090.00316.88
8.0.130.0140.00016.82
8.0.120.0140.00016.89
8.0.110.0090.00616.78
8.0.100.0150.00016.88
8.0.90.0090.00616.82
8.0.80.0060.00916.78
8.0.70.0060.00816.79
8.0.60.0140.00016.75
8.0.50.0090.00416.86
8.0.30.0130.00316.80
8.0.20.0090.00616.98
8.0.10.0050.01016.92

preferences:
40.2 ms | 403 KiB | 5 Q