3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 'id' => 5, 'name' => 'Item 5', 'all_parents' => [ 'id' => 4, 'name' => 'Item 4', 'all_parents' => [ 'id' => 3, 'name' => 'Item 3', 'all_parents' => [ 'id' => 2, 'name' => 'Item 2', 'all_parents' => [ 'id' => 1, 'name' => 'Item 1', 'all_parents' => null ] ] ] ] ]; class Recursing { public function generateBreadcrumb($structure): array { return array_merge( empty($structure['all_parents']) ? [] : $this->generateBreadcrumb($structure['all_parents']), [['id' => $structure['id'], 'name' => $structure['name']]] ); } } $test = new Recursing; var_export($test->generateBreadcrumb($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.140.0130.00717.41
8.4.130.0050.00520.45
8.4.120.0110.00924.25
8.4.110.0140.00720.59
8.4.100.0160.00417.76
8.4.90.0120.00817.89
8.4.80.0070.00117.77
8.4.70.0120.00817.70
8.4.60.0170.00517.94
8.4.50.0110.00918.59
8.4.40.0040.01219.29
8.4.30.0100.01020.21
8.4.20.0100.01017.93
8.4.10.0100.00019.40
8.3.270.0090.01116.42
8.3.260.0140.00616.66
8.3.250.0070.00818.52
8.3.240.0140.00616.75
8.3.230.0110.00916.73
8.3.220.0110.00817.34
8.3.210.0120.00616.57
8.3.200.0130.00616.47
8.3.190.0100.00716.82
8.3.180.0050.00318.34
8.3.170.0180.00018.92
8.3.160.0040.00418.30
8.3.150.0080.00018.45
8.3.140.0060.01217.20
8.3.130.0040.00418.67
8.3.120.0030.00619.03
8.3.110.0060.00316.63
8.3.100.0120.00316.44
8.3.90.0080.00026.77
8.3.80.0000.01116.73
8.3.70.0060.00916.75
8.3.60.0070.00718.43
8.3.50.0100.01020.34
8.3.40.0120.00319.08
8.3.30.0120.00619.09
8.3.20.0000.00724.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.290.0090.00122.25
8.2.280.0110.01018.26
8.2.270.0060.01318.83
8.2.260.0150.00416.76
8.2.250.0000.02017.00
8.2.240.0030.00618.80
8.2.230.0000.01020.94
8.2.220.0180.00424.06
8.2.210.0030.00526.77
8.2.200.0030.00618.16
8.2.190.0160.00616.58
8.2.180.0150.00025.92
8.2.170.0130.00718.95
8.2.160.0070.00722.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00021.05
8.2.110.0040.00420.47
8.2.100.0090.00317.91
8.2.90.0050.00319.22
8.2.80.0040.00417.97
8.2.70.0000.00917.50
8.2.60.0090.00018.05
8.2.50.0000.00818.07
8.2.40.0000.00818.22
8.2.30.0000.00718.07
8.2.20.0000.00720.30
8.2.10.0050.00217.80
8.2.00.0000.00719.24
8.1.330.0040.00522.13
8.1.320.0100.00920.04
8.1.310.0070.00718.41
8.1.300.0050.00318.48
8.1.290.0070.00330.84
8.1.280.0060.01025.92
8.1.270.0060.00320.53
8.1.260.0060.00326.35
8.1.250.0070.00028.09
8.1.240.0040.00423.83
8.1.230.0080.00417.82
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0030.00617.36
8.1.190.0080.00017.10
8.1.180.0000.00918.10
8.1.170.0050.00318.43
8.1.160.0040.00418.92
8.1.150.0040.00418.57
8.1.140.0040.00417.50
8.1.130.0000.00718.82
8.1.120.0040.00417.36
8.1.110.0040.00417.46
8.1.100.0050.00217.44
8.1.90.0000.00717.46
8.1.80.0030.00617.34
8.1.70.0070.00017.47
8.1.60.0000.00817.56
8.1.50.0040.00417.49
8.1.40.0000.00717.50
8.1.30.0050.00517.64
8.1.20.0220.00017.58
8.1.10.0150.00517.52
8.1.00.0160.00817.39
8.0.300.0060.00318.77
8.0.290.0000.00816.75
8.0.280.0030.00518.36
8.0.270.0030.00316.75
8.0.260.0000.00618.38
8.0.250.0080.00016.94
8.0.240.0030.00516.93
8.0.230.0020.00516.86
8.0.220.0090.00016.89
8.0.210.0030.00316.88
8.0.200.0030.00316.93
8.0.190.0000.00816.98
8.0.180.0040.00416.90
8.0.170.0000.00816.91
8.0.160.0090.00916.78
8.0.150.0150.00416.74
8.0.140.0110.00816.80
8.0.130.0130.00916.81
8.0.120.0120.00616.89
8.0.110.0090.00916.76
8.0.100.0150.00316.76
8.0.90.0160.00216.81
8.0.80.0140.00616.77
8.0.70.0190.00016.73
8.0.60.0090.00916.88
8.0.50.0190.00016.71
8.0.30.0190.00016.83
8.0.20.0160.00316.94
8.0.10.0150.00416.84
7.4.330.0000.00615.55
7.4.320.0060.00016.61
7.4.300.0030.00316.63
7.4.290.0030.00316.55
7.4.280.0150.00516.54
7.4.270.0120.00616.63
7.4.260.0110.01116.55
7.4.250.0170.00616.43
7.4.240.0180.00616.46
7.4.230.0180.00616.59
7.4.220.0160.00416.57
7.4.210.0060.01316.59
7.4.200.0150.00316.41
7.4.190.0110.00716.45
7.4.180.0120.00616.47
7.4.160.0190.00016.65
7.4.150.0190.00016.36
7.4.140.0170.00316.42
7.4.130.0040.00416.45
7.4.120.0100.00216.45
7.4.110.0040.00816.33
7.4.100.0140.00316.48
7.4.90.0120.00016.38
7.4.80.0070.00316.46
7.4.70.0050.00216.54
7.4.60.0030.00316.34
7.4.50.0040.00416.45
7.4.40.0070.00016.32
7.4.30.0000.00616.33
7.4.20.0040.00416.55
7.4.10.0080.00316.43
7.4.00.0080.00316.48

preferences:
37.57 ms | 403 KiB | 5 Q