3v4l.org

run code in 300+ PHP versions simultaneously
<?php // $result = $conn->query("SELECT content, sub_content FROM objectives"); $result = [ ["content" => "Demonstrate where to find the following documentation:", "sub_content" => "Operating and Safety Strategy"], ["content" => "Explain the different turbine main operating states:", "sub_content" => "0"], ["content" => "Explain the different turbine main operating states:", "sub_content" => "Power Production"], ["content" => "Explain the different turbine main operating states:", "sub_content" => "Idle"], ["content" => "Explain the different turbine main operating states:", "sub_content" => "Stop"], ["content" => "Explain how to recognise the current operating mode on the display of the operating panel", "sub_content" => "0"], ["content" => "Explain the subsystem operating modes:", "sub_content" => "Stop"], ["content" => "Explain the subsystem operating modes:", "sub_content" => "Manual"], ["content" => "Explain the subsystem operating modes:", "sub_content" => "0"], ["content" => "Explain the difference between local and remote point of operation", "sub_content" => "0"], ["content" => "Explain that only one point of operation can be active at a time", "sub_content" => "0"] ]; $category = null; $output = ''; foreach ($result as $row) { if ($category !== $row['content']) { // new parent if ($category !== null) { // not first iteration $output .= "\t<li>$category"; // print parent if ($sublist) { $output .= "\n\t\t<ul>$sublist\n\t\t</ul>\n\t"; // print all children } $output .= "</li>\n"; } $category = $row['content']; // overwrite $category $sublist = ''; // reset sublist } if ($row['sub_content'] !== '0'){ // filter row $sublist .= "\n\t\t\t<li>{$row['sub_content']}</li>"; } } if ($result) { // in case the resultset is empty echo "<ul>\n"; echo $output; // print stored markup echo "\t<li>$category"; // print last parent if ($sublist) { echo "\n\t\t<ul>$sublist\n\t\t</ul>\n\t"; // print all children from last parent } echo "</li>\n"; echo "</ul>"; }

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.10.0100.00816.86
8.5.00.0120.01019.80
8.4.160.0100.01221.60
8.4.150.0020.00014.05
8.4.140.0080.01217.71
8.4.130.0090.01117.65
8.4.120.0100.01124.02
8.4.110.0130.00722.63
8.4.100.0150.00517.69
8.4.90.0050.00520.46
8.4.80.0120.00718.00
8.4.70.0040.00517.67
8.4.60.0080.00520.72
8.4.50.0120.00818.62
8.4.40.0060.01017.57
8.4.30.0130.00619.56
8.4.20.0070.01419.38
8.4.10.0090.00019.61
8.3.280.0080.00918.50
8.3.270.0110.00916.52
8.3.260.0110.00916.77
8.3.250.0090.00919.01
8.3.240.0150.00416.69
8.3.230.0090.01016.48
8.3.220.0040.00321.00
8.3.210.0140.00616.55
8.3.200.0090.01116.60
8.3.190.0100.00717.28
8.3.180.0110.00817.29
8.3.170.0090.00920.94
8.3.160.0060.01316.96
8.3.150.0140.00417.20
8.3.140.0030.00618.57
8.3.130.0060.00616.63
8.3.120.0080.00018.85
8.3.110.0030.00620.94
8.3.100.0000.00916.60
8.3.90.0150.00018.56
8.3.80.0030.00618.55
8.3.70.0110.00616.75
8.3.60.0090.00918.43
8.3.50.0120.00916.60
8.3.40.0170.00018.60
8.3.30.0070.00718.67
8.3.20.0040.00421.73
8.3.10.0080.00023.61
8.3.00.0080.00023.52
8.2.290.0100.00817.42
8.2.280.0110.00818.37
8.2.270.0140.00417.23
8.2.260.0040.00418.61
8.2.250.0030.00516.44
8.2.240.0030.00618.93
8.2.230.0030.00722.58
8.2.220.0100.00624.06
8.2.210.0000.00826.77
8.2.200.0030.00618.16
8.2.190.0150.00616.63
8.2.180.0060.00918.62
8.2.170.0150.00822.96
8.2.160.0100.00319.93
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0080.00022.31
8.2.120.0000.00726.35
8.2.110.0060.00320.35
8.2.100.0080.00419.76
8.2.90.0000.00818.03
8.2.80.0080.00018.34
8.2.70.0060.00318.03
8.2.60.0080.00018.09
8.2.50.0030.00518.10
8.2.40.0050.00320.47
8.2.30.0000.00820.50
8.2.20.0070.00018.17
8.2.10.0000.00718.14
8.2.00.0070.00018.04
8.1.330.0110.00716.66
8.1.320.0110.00916.30
8.1.310.0090.00616.92
8.1.300.0060.01318.34
8.1.290.0060.00318.88
8.1.280.0120.00325.92
8.1.270.0040.00422.07
8.1.260.0000.00726.35
8.1.250.0060.00328.09
8.1.240.0070.00419.26
8.1.230.0080.00420.89
8.1.220.0050.00317.79
8.1.210.0060.00318.77
8.1.200.0030.00617.23
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0090.00018.49
8.1.160.0040.00418.76
8.1.150.0000.00722.05
8.1.140.0040.00417.62
8.1.130.0000.00719.05
8.1.120.0050.00317.44
8.1.110.0000.00717.42
8.1.100.0030.00317.34
8.1.90.0040.00417.45
8.1.80.0040.00417.43
8.1.70.0030.00317.36
8.1.60.0100.00017.51
8.1.50.0000.00817.55
8.1.40.0000.00717.54
8.1.30.0030.00617.54
8.1.20.0000.00817.66
8.1.10.0000.00817.45
8.1.00.0000.00817.40
8.0.300.0000.00719.67
8.0.290.0030.00616.75
8.0.280.0000.00718.38
8.0.270.0040.00417.25
8.0.260.0000.00716.84
8.0.250.0030.00616.85
8.0.240.0000.00716.96
8.0.230.0040.00416.95
8.0.220.0000.00816.78
8.0.210.0000.00716.78
8.0.200.0030.00316.84
8.0.190.0000.00716.80
8.0.180.0040.00416.77
8.0.170.0030.00616.89
8.0.160.0070.00016.87
8.0.150.0040.00316.86
8.0.140.0030.00316.74
8.0.130.0000.00513.31
8.0.120.0040.00416.87
8.0.110.0040.00416.98
8.0.100.0050.00316.88
8.0.90.0040.00416.86
8.0.80.0030.01316.89
8.0.70.0030.00516.75
8.0.60.0000.00716.85
8.0.50.0080.00016.76
8.0.30.0080.01417.23
8.0.20.0060.01517.40
8.0.10.0040.00417.11
8.0.00.0070.01016.79
7.4.330.0000.00515.55
7.4.320.0030.00316.38
7.4.300.0070.00016.44
7.4.290.0070.00016.54
7.4.280.0030.00516.51
7.4.270.0000.00716.61
7.4.260.0050.00316.48
7.4.250.0030.00316.54
7.4.240.0080.00016.50
7.4.230.0000.00716.42
7.4.220.0000.00716.35
7.4.210.0120.00916.64
7.4.200.0000.00716.40
7.4.160.0070.01116.58
7.4.140.0090.00817.86
7.4.130.0060.01216.39
7.4.120.0060.01216.44
7.4.110.0080.01316.56
7.4.100.0130.00316.64
7.4.90.0070.01016.38
7.4.80.0120.01219.39
7.4.70.0130.01016.46
7.4.60.0100.00716.40
7.4.50.0000.01216.66
7.4.40.0090.00616.58
7.4.00.0040.01114.91
7.3.330.0000.00713.07
7.3.320.0030.00313.22
7.3.310.0040.00416.33
7.3.300.0070.00016.18
7.3.290.0050.01016.32
7.3.280.0080.01116.33
7.3.260.0110.01016.46
7.3.250.0120.00616.38
7.3.240.0060.01316.28
7.3.230.0000.01616.45
7.3.210.0070.01016.65
7.3.200.0070.01016.49
7.3.190.0060.00916.59
7.3.180.0030.01516.60
7.3.170.0120.00416.68
7.3.160.0110.00916.41
7.2.330.0110.01116.73
7.2.320.0030.01516.56
7.2.310.0000.02216.78
7.2.300.0040.01816.63
7.2.290.0110.00716.86
7.2.60.0090.00616.77
7.2.30.0090.01817.59
7.2.20.0110.01517.49
7.2.10.0120.01417.77
7.2.00.0100.01818.15
7.1.200.0070.00715.58
7.1.150.0410.01316.80
7.1.140.0110.01516.92
7.1.130.0140.01416.55
7.1.120.0100.01216.86
7.1.110.0220.01315.85
7.1.100.0130.01115.98
7.1.90.0170.01316.23
7.1.80.0130.01416.06
7.1.70.0150.00815.40
7.1.60.0470.01133.36
7.1.50.0270.01332.91
7.1.40.0400.01232.53
7.1.30.0320.01832.54
7.1.20.0320.02132.86
7.1.10.0110.01514.61
7.1.00.0110.01415.01

preferences:
55.63 ms | 403 KiB | 5 Q