3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array( 0 => array( "text" => "eventyrer", "children"=> array( 4 => array( "text" => "news", "children"=> array( 1=> array("text"=>"a") ) ), 5 => array( "text" => "nyheter", "children"=> array( 1=> array("text"=>"b") ) ) ) ), 1 => array( "text" => "eventyrer2017", "children"=> array( 6 => array( "text" => "news", "children"=> array( 1=> array("text"=>"c") ) ), 8 => array( "text" => "nyheter", "children"=> array( 1=> array( "text"=>"d", "children"=> array( 1=> array("text"=>"e") ) ) ) ) ) ) ); $new_array = []; foreach($arr as &$value) { //loop through first set foreach($value['children'] as $child) { //loop through children, create a string that contains the first set of values "text", and the childrens "text" $string = "{$value['text']}/{$child['text']}"; foreach($child['children'] as $child2) { //loop through each child of child1 and add a new string to the new_array containing `$string` + the child2. $new_array[] = $string .= "/{$child2['text']}"; } } } var_export($new_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.3.60.0100.01018.55
8.3.50.0150.00318.27
8.3.40.0150.00618.79
8.3.30.0070.00718.69
8.3.20.0030.00619.16
8.3.10.0080.00021.87
8.3.00.0060.00320.58
8.2.180.0060.00918.41
8.2.170.0100.01019.09
8.2.160.0100.00322.96
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00419.64
8.2.120.0000.00826.35
8.2.110.0100.01021.06
8.2.100.0090.00317.78
8.2.90.0000.00819.34
8.2.80.0000.00817.97
8.2.70.0080.00017.79
8.2.60.0030.00518.16
8.2.50.0040.00418.10
8.2.40.0040.00419.39
8.2.30.0040.00419.30
8.2.20.0030.00717.93
8.2.10.0070.00018.03
8.2.00.0030.00517.59
8.1.280.0060.00925.92
8.1.270.0000.00722.02
8.1.260.0090.00926.35
8.1.250.0080.00028.09
8.1.240.0030.00622.64
8.1.230.0110.00020.97
8.1.220.0000.00817.76
8.1.210.0000.00818.84
8.1.200.0040.00417.35
8.1.190.0040.00417.10
8.1.180.0050.00318.10
8.1.170.0030.00518.58
8.1.160.0040.00418.76
8.1.150.0050.00318.94
8.1.140.0000.00722.20
8.1.130.0030.00320.13
8.1.120.0070.00017.45
8.1.110.0040.00417.43
8.1.100.0050.00217.46
8.1.90.0050.00217.38
8.1.80.0040.00417.40
8.1.70.0030.00517.46
8.1.60.0060.00317.58
8.1.50.0040.00417.40
8.1.40.0040.00417.40
8.1.30.0060.00617.58
8.1.20.0040.00417.63
8.1.10.0050.00517.57
8.1.00.0040.00417.47
8.0.300.0070.00020.03
8.0.290.0000.00816.63
8.0.280.0030.00318.51
8.0.270.0030.00317.26
8.0.260.0030.00518.44
8.0.250.0000.00616.95
8.0.240.0060.00016.95
8.0.230.0040.00416.95
8.0.220.0050.00516.92
8.0.210.0000.00716.79
8.0.200.0060.00016.96
8.0.190.0000.00816.91
8.0.180.0040.00416.78
8.0.170.0040.00416.94
8.0.160.0040.00416.85
8.0.150.0090.00016.69
8.0.140.0000.00816.84
8.0.130.0000.00513.28
8.0.120.0050.00316.93
8.0.110.0000.00716.92
8.0.100.0050.00316.73
8.0.90.0080.00017.00
8.0.80.0070.01316.90
8.0.70.0080.00017.00
8.0.60.0040.00416.67
8.0.50.0000.00816.88
8.0.30.0090.00917.07
8.0.20.0250.00017.40
8.0.10.0030.00516.97
8.0.00.0120.01016.75
7.4.330.0050.00015.55
7.4.320.0000.00616.49
7.4.300.0060.00016.60
7.4.290.0040.00416.58
7.4.280.0070.00016.50
7.4.270.0080.00016.52
7.4.260.0000.00716.38
7.4.250.0070.00016.46
7.4.240.0060.00316.45
7.4.230.0030.00316.66
7.4.220.0030.00616.50
7.4.210.0080.00816.58
7.4.200.0070.00016.48
7.4.160.0120.00616.49
7.4.140.0060.01217.86
7.4.130.0100.00716.36
7.4.120.0100.00916.48
7.4.110.0040.01516.39
7.4.100.0120.00616.34
7.4.90.0130.00416.57
7.4.80.0190.00319.39
7.4.70.0060.01016.58
7.4.60.0120.00316.63
7.4.50.0030.00916.52
7.4.40.0110.00716.68
7.4.00.0080.00715.00
7.3.330.0020.00213.25
7.3.320.0060.00013.23
7.3.310.0060.00316.32
7.3.300.0050.00216.33
7.3.290.0000.00716.30
7.3.280.0060.01116.22
7.3.260.0110.01016.50
7.3.240.0090.00816.38
7.3.230.0160.00816.34
7.3.210.0130.00316.42
7.3.200.0030.01316.41
7.3.190.0110.00616.30
7.3.180.0090.00916.59
7.3.170.0090.01216.31
7.3.160.0100.00716.70
7.3.120.0080.00814.68
7.3.110.0030.01314.98
7.3.100.0130.00314.99
7.3.90.0070.00714.90
7.3.80.0040.01214.82
7.3.70.0070.00414.51
7.3.60.0000.01414.75
7.3.50.0040.01214.75
7.3.40.0000.01314.79
7.3.30.0040.01414.61
7.3.20.0040.00816.70
7.3.10.0030.00616.50
7.3.00.0030.00916.38
7.2.330.0060.01116.87
7.2.320.0190.00316.80
7.2.310.0110.01016.41
7.2.300.0100.00616.66
7.2.290.0050.01116.64
7.2.250.0070.01115.30
7.2.240.0060.01314.91
7.2.230.0120.00414.87
7.2.220.0040.00814.61
7.2.210.0090.00314.94
7.2.200.0040.00814.90
7.2.190.0040.01115.08
7.2.180.0040.00915.18
7.2.170.0040.01114.98
7.2.110.0200.01014.49
7.2.100.0250.00714.76
7.2.90.0200.00714.99
7.2.80.0210.00914.75
7.2.70.0190.00314.61
7.2.60.0240.00314.82
7.2.50.0230.00715.13
7.2.40.0180.00715.15
7.2.30.0220.00314.79
7.2.20.1330.00314.83
7.2.10.0240.00615.18
7.2.00.0150.00914.77
7.1.330.0060.00915.95
7.1.320.0060.00915.65
7.1.310.0030.01015.69
7.1.300.0040.00815.70
7.1.290.0040.00815.79
7.1.280.0100.00315.62
7.1.270.0030.01415.37
7.1.260.0030.00615.45
7.1.230.0270.00714.02
7.1.220.0180.00713.75
7.1.210.0230.00413.76
7.1.200.0210.00313.93
7.1.190.0140.01113.97
7.1.180.0200.00713.46
7.1.170.0130.01013.76
7.1.160.0270.00313.58
7.1.150.0190.00913.57
7.1.140.0220.00613.61
7.1.130.0260.00613.89
7.1.120.0250.00613.52
7.1.110.0230.00814.00
7.1.100.0260.01013.80
7.1.90.0200.00314.08
7.1.80.0110.01114.18
7.1.70.0230.00313.96
7.1.60.0370.01131.68
7.1.50.0330.01031.97
7.1.40.0260.01631.54
7.1.30.0440.01531.94
7.1.20.0350.00631.60
7.1.10.0190.00614.01
7.1.00.0270.01114.14
5.6.380.0080.00914.59

preferences:
43.33 ms | 401 KiB | 5 Q