3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ [ "id" => "127", "title" => "Apple", "deleted" => "0", "parent" => NULL, "usp_id" => "445", "user_id" => NULL, ], [ "id" => "159", "title" => "Renault Duster", "deleted" => "0", "parent" => NULL, "usp_id" => "495", "user_id" => NULL, ], [ "id" => "7", "title" => "Services", "deleted" => "0", "parent" => "127", "usp_id" => "79", "user_id" => "275", ], ]; foreach ($arr as $key0 => $record) { if (null !== $record['parent']) { foreach ($arr as $key1 => $parent) { if ($parent['id'] === $record['parent']) { $arr[$key1]['children'][] = $record; // push child into parent['sub'] unset($arr[$key0]); // delete child } } } } print_r($arr);

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.130.0110.00919.40
8.4.120.0100.00920.23
8.4.110.0100.01120.79
8.4.100.0110.00817.73
8.4.90.0100.01118.72
8.4.80.0110.00517.90
8.4.70.0140.00617.62
8.4.60.0060.00218.73
8.4.50.0060.00318.33
8.4.40.0060.00919.31
8.4.30.0070.00318.33
8.4.20.0070.00418.64
8.4.10.0060.01019.41
8.3.250.0130.00519.12
8.3.240.0140.00517.29
8.3.230.0110.00816.79
8.3.220.0070.00917.14
8.3.210.0110.00718.48
8.3.200.0050.00416.73
8.3.190.0060.00417.04
8.3.180.0130.00616.70
8.3.170.0130.00616.89
8.3.160.0090.00918.77
8.3.150.0040.00416.45
8.3.140.0100.01017.18
8.3.130.0120.00618.47
8.3.120.0130.00320.84
8.3.110.0030.00620.94
8.3.100.0080.00024.06
8.3.90.0120.00618.42
8.3.80.0080.00016.63
8.3.70.0040.01118.43
8.3.60.0140.00718.31
8.3.50.0070.00718.45
8.3.40.0090.00618.85
8.3.30.0110.00318.63
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0040.00426.16
8.2.290.0060.00420.67
8.2.280.0110.00918.55
8.2.270.0060.01317.27
8.2.260.0070.00716.55
8.2.250.0090.00916.74
8.2.240.0030.00717.13
8.2.230.0050.00322.58
8.2.220.0000.00837.54
8.2.210.0150.00026.77
8.2.200.0100.00018.29
8.2.190.0110.00716.58
8.2.180.0070.01425.92
8.2.170.0070.00718.91
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0040.00419.95
8.2.110.0060.00322.13
8.2.100.0080.00319.70
8.2.90.0040.00417.75
8.2.80.0040.00418.71
8.2.70.0030.00618.03
8.2.60.0060.00318.12
8.2.50.0000.00818.10
8.2.40.0060.00321.20
8.2.30.0040.00419.38
8.2.20.0000.00818.08
8.2.10.0040.00419.18
8.2.00.0030.00519.39
8.1.330.0130.00616.88
8.1.320.0110.00815.97
8.1.310.0000.00820.41
8.1.300.0040.01218.34
8.1.290.0060.00318.88
8.1.280.0070.00725.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00819.11
8.1.230.0110.00017.77
8.1.220.0030.00517.79
8.1.210.0040.00418.77
8.1.200.0080.00317.35
8.1.190.0000.00817.23
8.1.180.0000.00818.10
8.1.170.0040.00418.50
8.1.160.0040.00418.80
8.1.150.0040.00418.74
8.1.140.0030.00518.89
8.1.130.0030.00317.44
8.1.120.0080.00017.43
8.1.110.0000.00817.36
8.1.100.0000.00817.42
8.1.90.0030.00617.47
8.1.80.0040.00417.34
8.1.70.0030.00317.48
8.1.60.0030.00617.57
8.1.50.0000.00817.50
8.1.40.0040.00417.42
8.1.30.0050.00317.54
8.1.20.0040.00417.61
8.1.10.0070.00317.57
8.1.00.0040.00417.50
8.0.300.0060.00318.77
8.0.290.0000.00816.63
8.0.280.0040.00418.44
8.0.270.0040.00416.80
8.0.260.0060.00016.77
8.0.250.0000.00716.85
8.0.240.0000.00716.95
8.0.230.0070.00016.84
8.0.220.0080.00016.75
8.0.210.0030.00316.90
8.0.200.0000.00716.99
8.0.190.0030.00516.96
8.0.180.0030.00416.96
8.0.170.0090.00016.92
8.0.160.0040.00416.88
8.0.150.0000.00816.80
8.0.140.0070.00016.93
8.0.130.0030.00313.30
8.0.120.0000.00816.79
8.0.110.0040.00416.80
8.0.100.0040.00416.86
8.0.90.0000.00816.91
8.0.80.0110.00716.88
8.0.70.0000.00716.80
8.0.60.0080.00016.76
8.0.50.0000.00716.71
8.0.30.0180.00716.84
8.0.20.0110.01516.91
8.0.10.0200.00816.98
8.0.00.0120.00417.06
7.4.330.0000.00415.55
7.4.320.0000.00616.48
7.4.300.0000.00616.46
7.4.290.0050.00216.62
7.4.280.0000.00716.46
7.4.270.0020.00516.42
7.4.260.0050.00013.34
7.4.250.0000.00716.46
7.4.240.0040.00416.49
7.4.230.0030.00316.41
7.4.220.0070.00016.48
7.4.210.0030.01016.54
7.4.200.0000.00716.46
7.4.160.0170.01416.47
7.4.150.0230.00316.60
7.4.140.0120.01316.46
7.4.130.0140.01116.43
7.4.120.0180.00716.50
7.4.110.0140.01116.49
7.4.100.0090.01416.57
7.4.90.0210.00716.51
7.4.80.0190.00416.38
7.4.70.0120.01216.47
7.4.60.0210.00716.39
7.4.50.0170.00616.38
7.4.40.0200.00416.48
7.4.30.0230.00016.50
7.4.20.0220.00416.50
7.4.10.0150.01116.36
7.4.00.0150.01216.45
7.3.330.0060.00316.32
7.3.320.0000.00513.16
7.3.310.0060.00016.29
7.3.300.0030.00316.29
7.3.290.0080.00916.36
7.3.280.0190.00716.33
7.3.270.0240.00316.39
7.3.260.0190.01216.26
7.3.250.0210.01116.27
7.3.240.0280.00616.34
7.3.230.0210.00616.39
7.3.220.0270.00916.30
7.3.210.0210.00916.21
7.3.200.0280.00316.20
7.3.190.0220.00916.25
7.3.180.0210.01516.24
7.3.170.0300.00916.33
7.3.160.0270.01016.25
7.3.150.0210.00616.24
7.3.140.0240.00316.25
7.3.130.0200.01016.29
7.3.120.0160.01316.23
7.3.110.0250.00416.23
7.3.100.0150.01616.15
7.3.90.0160.01316.51
7.3.80.0160.00916.21
7.3.70.0140.01016.40
7.3.60.0160.00916.51
7.3.50.0250.00516.36
7.3.40.0310.00316.36
7.3.30.0260.00716.50
7.3.20.0390.00416.50
7.3.10.0220.01116.31
7.3.00.0220.00316.39

preferences:
31.08 ms | 403 KiB | 5 Q