3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pages = array(); $pages[1] = array('id' => 1, 'parent' => 0, 'name' => 'Hello World'); $pages[2] = array('id' => 1, 'parent' => 1, 'name' => 'Child of Hello World'); $pages[3] = array('id' => 1, 'parent' => 0, 'name' => 'Brother of Hello World'); $pages[4] = array('id' => 4, 'parent' => 2, 'name' => 'Grand-child of Hello World'); $pages[6] = array('id' => 6, 'parent' => 4, 'name' => 'Great-grand-child of Hello World'); $children = array(); foreach($pages as $key => $page){ $parent = (int)$page['parent']; if(!isset($children[$parent])){ $children[$parent] = array(); $children[$parent][$key] = array('id' => $page['id'], 'name' => $page['name']); } } var_dump($children);

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.3.70.0120.00616.38
8.3.60.0160.00616.63
8.3.50.0120.00918.02
8.3.40.0030.01318.71
8.3.30.0120.00318.44
8.3.20.0080.00023.43
8.3.10.0050.00323.68
8.3.00.0040.00422.40
8.2.190.0130.00616.75
8.2.180.0090.00918.54
8.2.170.0160.00322.96
8.2.160.0070.00719.51
8.2.150.0060.00324.18
8.2.140.0050.00524.66
8.2.130.0080.00026.16
8.2.120.0050.00326.16
8.2.110.0030.00721.11
8.2.100.0110.00019.40
8.2.90.0040.00417.75
8.2.80.0040.00419.66
8.2.70.0000.00917.90
8.2.60.0080.00017.98
8.2.50.0050.00318.10
8.2.40.0050.00319.29
8.2.30.0040.00419.25
8.2.20.0000.00818.18
8.2.10.0040.00419.23
8.2.00.0040.00419.33
8.1.280.0070.00725.92
8.1.270.0040.00420.82
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0040.00423.78
8.1.230.0030.00922.09
8.1.220.0070.00317.76
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0060.00317.23
8.1.180.0050.00318.10
8.1.170.0030.00618.59
8.1.160.0040.00418.86
8.1.150.0000.00718.82
8.1.140.0040.00420.90
8.1.130.0080.00020.04
8.1.120.0000.00717.45
8.1.110.0000.00917.38
8.1.100.0020.00517.45
8.1.90.0000.00817.38
8.1.80.0000.00717.49
8.1.70.0000.00717.37
8.1.60.0080.00017.49
8.1.50.0040.00417.52
8.1.40.0000.00817.49
8.1.30.0040.00417.50
8.1.20.0050.00317.66
8.1.10.0050.00317.54
8.1.00.0040.00417.33
8.0.300.0040.00419.77
8.0.290.0000.00716.63
8.0.280.0040.00418.45
8.0.270.0050.00317.32
8.0.260.0030.00320.13
8.0.250.0000.00816.87
8.0.240.0020.00516.98
8.0.230.0030.00516.85
8.0.220.0050.00516.80
8.0.210.0040.00416.78
8.0.200.0000.00716.93
8.0.190.0050.00316.96
8.0.180.0040.00416.83
8.0.170.0090.00016.95
8.0.160.0040.00416.89
8.0.150.0040.00416.85
8.0.140.0000.00716.90
8.0.130.0000.00613.27
8.0.120.0050.00516.89
8.0.110.0000.00716.78
8.0.100.0050.00216.80
8.0.90.0060.00316.93
8.0.80.0080.00816.84
8.0.70.0040.00416.92
8.0.60.0030.00616.79
8.0.50.0040.00416.95
8.0.30.0070.01417.08
8.0.20.0170.00317.06
8.0.10.0040.00416.97
8.0.00.0150.00916.62
7.4.330.0000.00515.55
7.4.320.0030.00316.39
7.4.300.0060.00016.51
7.4.290.0000.00716.56
7.4.280.0050.00316.43
7.4.270.0040.00416.57
7.4.260.0000.00513.30
7.4.250.0040.00416.39
7.4.240.0040.00416.58
7.4.230.0040.00416.59
7.4.220.0030.00316.46
7.4.210.0080.00816.57
7.4.200.0000.00816.42
7.4.140.0110.00717.86
7.4.130.0080.01416.63
7.4.120.0150.00316.57
7.4.110.0120.00816.47
7.4.100.0100.00816.52
7.4.90.0070.01116.60
7.4.80.0170.00319.39
7.4.70.0090.00916.66
7.4.60.0080.01116.50
7.4.50.0120.00316.54
7.4.40.0040.01416.41
7.4.00.0000.01515.21
7.3.330.0000.00716.40
7.3.320.0050.00013.07
7.3.310.0030.00316.30
7.3.300.0070.00016.18
7.3.290.0070.01016.26
7.3.280.0130.00716.36
7.3.260.0070.01416.44
7.3.240.0080.00916.44
7.3.230.0060.01216.34
7.3.210.0110.00616.53
7.3.200.0060.01116.41
7.3.190.0140.00316.47
7.3.180.0060.01616.46
7.3.170.0120.00416.24
7.3.160.0030.01216.32
7.3.90.0120.00914.85
7.3.80.0060.00614.81
7.3.70.0080.01114.91
7.3.60.0050.00814.72
7.3.50.0110.00314.79
7.3.40.0000.01414.82
7.3.30.0080.00614.61
7.3.20.0090.00914.71
7.3.10.0130.00314.95
7.3.00.0060.01015.03
7.2.330.0120.00616.58
7.2.320.0040.01416.39
7.2.310.0110.01416.49
7.2.300.0090.00916.40
7.2.290.0130.00316.58
7.2.220.0030.01414.86
7.2.210.0040.01114.77
7.2.200.0070.01215.05
7.2.190.0050.00914.76
7.2.180.0070.00715.01
7.2.170.0140.00015.09
7.2.160.0070.00714.82
7.2.150.0140.00314.99
7.2.140.0060.00915.23
7.2.130.0100.01414.95
7.2.120.0070.01014.98
7.2.110.0060.01115.15
7.2.100.0040.01115.33
7.2.90.0160.00715.13
7.2.80.0100.00715.13
7.2.70.0130.00415.12
7.2.60.0080.00814.88
7.2.50.0430.01315.17
7.2.40.0120.01114.86
7.2.30.0100.00615.12
7.2.20.0110.00515.18
7.2.10.0100.00715.09
7.2.00.0140.00315.34
7.1.320.0090.00614.05
7.1.310.0040.01714.03
7.1.300.0070.00713.98
7.1.290.0030.01313.92
7.1.280.0110.00514.02
7.1.270.0060.00914.08
7.1.260.0090.00613.95
7.1.250.0130.00913.93

preferences:
21.09 ms | 401 KiB | 5 Q