3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = <<<JSON [ { "department": "CIS", "name": "Intro to CIS", "sections": [ { "sectionNumber": "01", "regNum": "012345", "days": "MWF", "startTime": "900", "endTime": "1030", "labDay": "M", "labStartTime": "1300", "labEndTime": "1500" }, { "sectionNumber": "02", "regNum": "098304", "days": "TR", "startTime": "1300", "endTime": "1500", "labDay": "", "labStartTime": "", "labEndTime": "" } ] }, { "department": "MATH", "name": "Intro to MATH", "sections": [ { "sectionNumber": "01", "regNum": "012345", "days": "MWF", "startTime": "900", "endTime": "1030", "labDay": "M", "labStartTime": "1300", "labEndTime": "1500" }, { "sectionNumber": "02", "regNum": "098304", "days": "TR", "startTime": "1300", "endTime": "1500", "labDay": "", "labStartTime": "", "labEndTime": "" } ] } ] JSON; $jsonArrayEntry = json_decode($data, true); function crossProduct() { $_ = func_get_args(); if (count($_) == 0) { return array(array()); } $a = array_shift($_); $c = call_user_func_array('crossProduct', $_); $r = array(); foreach ($a as $v) { foreach ($c as $p) { $r[] = array_merge(array($v), $p); } } return $r; } $allDepartmentsSections = []; foreach ($jsonArrayEntry as $entry) { $sections = []; foreach ($entry["sections"] as $section) { $sections[] = $section + [ "department" => $entry["department"], "name"=>$entry["name"] ]; } $allDepartmentsSections[] = $sections; } print_r(call_user_func_array('crossProduct', $allDepartmentsSections));

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.120.0100.00826.13
8.4.110.0100.01018.88
8.4.100.0120.00917.48
8.4.90.0120.00920.16
8.4.80.0140.00620.45
8.4.70.0060.00419.45
8.4.60.0060.00518.75
8.4.50.0120.01018.80
8.4.40.0100.01018.38
8.4.30.0110.00420.39
8.4.20.0170.00319.37
8.4.10.0080.00024.11
8.3.250.0130.00519.21
8.3.240.0110.00816.81
8.3.230.0080.01016.59
8.3.220.0100.01018.98
8.3.210.0100.00916.73
8.3.200.0050.00416.54
8.3.190.0070.00217.34
8.3.180.0060.00318.93
8.3.170.0060.01317.08
8.3.160.0140.00418.66
8.3.150.0040.00416.49
8.3.140.0100.00718.95
8.3.130.0030.00516.69
8.3.120.0090.00320.82
8.3.110.0000.01120.94
8.3.100.0060.00316.61
8.3.90.0030.00526.77
8.3.80.0090.00316.63
8.3.70.0080.00816.63
8.3.60.0080.00818.43
8.3.50.0110.00420.03
8.3.40.0150.00419.10
8.3.30.0140.00019.09
8.3.20.0070.00024.18
8.3.10.0000.00724.66
8.3.00.0040.00426.16
8.2.290.0090.01017.04
8.2.280.0120.00616.59
8.2.270.0150.00416.61
8.2.260.0070.01116.90
8.2.250.0130.01016.42
8.2.240.0040.01117.31
8.2.230.0130.00622.58
8.2.220.0170.00324.06
8.2.210.0000.00926.77
8.2.200.0070.00718.29
8.2.190.0160.00016.75
8.2.180.0120.00325.92
8.2.170.0090.00622.96
8.2.160.0080.00622.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0080.00026.16
8.2.110.0070.00319.22
8.2.100.0090.00318.03
8.2.90.0040.00417.75
8.2.80.0000.00818.73
8.2.70.0060.00317.75
8.2.60.0080.00017.75
8.2.50.0000.00817.98
8.2.40.0050.00318.34
8.2.30.0070.00018.01
8.2.20.0040.00420.45
8.2.10.0040.00418.04
8.2.00.0050.00219.19
8.1.330.0110.00816.07
8.1.320.0120.00816.32
8.1.310.0110.00716.48
8.1.300.0080.00818.43
8.1.290.0090.00030.84
8.1.280.0030.01825.92
8.1.270.0050.00323.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00722.09
8.1.230.0040.00720.85
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0050.00317.35
8.1.190.0040.00417.23
8.1.180.0050.00318.10
8.1.170.0050.00317.62
8.1.160.0000.00718.82
8.1.150.0040.00418.65
8.1.140.0000.00917.45
8.1.130.0000.00717.50
8.1.120.0040.00417.39
8.1.110.0040.00417.49
8.1.100.0040.00417.48
8.1.90.0000.00717.52
8.1.80.0050.00317.36
8.1.70.0040.00417.46
8.1.60.0100.01017.52
8.1.50.0140.00317.46
8.1.40.0140.00517.49
8.1.30.0090.01017.55
8.1.20.0190.00017.68
8.1.10.0140.00417.60
8.1.00.0150.00317.45
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0060.00318.43
8.0.270.0040.00416.90
8.0.260.0040.00418.44
8.0.250.0050.00217.06
8.0.240.0000.00717.05
8.0.230.0000.00717.07
8.0.220.0060.00316.90
8.0.210.0000.00716.88
8.0.200.0030.00317.02
8.0.190.0070.00716.95
8.0.180.0050.01016.80
8.0.170.0150.00016.98
8.0.160.0060.00916.93
8.0.150.0120.00316.81
8.0.140.0080.00416.78
8.0.130.0120.00016.78
8.0.120.0000.00916.94
8.0.110.0130.00016.77
8.0.100.0070.00316.86
8.0.90.0070.00316.82
8.0.80.0080.00016.88
8.0.70.0000.01016.83
8.0.60.0050.00516.78
8.0.50.0050.01016.85
8.0.30.0080.00816.83
8.0.20.0130.00016.87
8.0.10.0030.01117.04
7.4.330.0020.00215.55
7.4.320.0070.00016.53
7.4.300.0070.00016.50
7.4.290.0110.00316.64
7.4.280.0120.00316.48
7.4.270.0090.00516.59
7.4.260.0080.00816.41
7.4.250.0140.00316.48
7.4.240.0160.00016.58
7.4.230.0160.00316.50
7.4.220.0060.00916.56
7.4.210.0060.00616.52
7.4.200.0080.00816.41
7.4.190.0090.00716.52
7.4.180.0070.00716.56
7.4.160.0120.00216.41
7.4.150.0040.01116.62
7.4.140.0090.00616.45
7.4.130.0110.00416.31
7.4.120.0110.00416.27
7.4.110.0130.00216.44
7.4.100.0160.00016.57
7.4.90.0150.00016.59
7.4.80.0140.00216.37
7.4.70.0150.00016.30
7.4.60.0030.00516.34
7.4.50.0030.00616.38
7.4.40.0100.00016.35
7.4.30.0090.00016.50
7.4.20.0080.00416.44
7.4.10.0050.00916.43
7.4.00.0110.00416.48

preferences:
117.16 ms | 403 KiB | 5 Q