3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ticketTypes = [ "ticketTypes" => [ "557968" => [ "section" => "235606", "amount" => "1" ], "604142"=> [ "section"=> "253594", "amount"=> "2" ] ], "delivery"=> [ "digitalPrintPass", "willcall", "mail", "digitalPrintPass" ] ]; $resultTypes = []; $deliveryOptions = []; $deliveryValues = ""; foreach ($ticketTypes as $key => $value) { if($key == 'ticketTypes'){ // print_r($key); -- printing "tickettypes" // print_r($value); $i = 0; foreach($value as $ticketTypeId => $sectionInfo){ $resultTypes[$i] = [ "ticketTypeId" => $ticketTypeId, "sectionId" => $sectionInfo['section'], "sectionAmount" => $sectionInfo['amount'] ]; $i++; } print_r($resultTypes); }elseif($key == 'delivery'){ foreach($value as $deliveryOption){ switch ($deliveryOption) { case "digitalPrintPass": $deliveryOptions[] = 'H'; break; case "willcall": $deliveryOptions[] = 'W'; break; case "mail": $deliveryOptions[] = 'M'; break; } } $deliveryValues = implode(",", $deliveryOptions); // $resultTypes[0] = [] } echo $deliveryValues; } // DONE -----> expect an array of price types (TICKET_TYPE) matched with a section and a quantity // DONE -----> create an empty array called something like matchingRequests // loop through all requests still in "REQUESTED" (see WAITLIST_STATUS table) state (possibly limited only to requests with selected price types), ordered by earliest submission time first. waitlist status table requested is id 1 // SQL_BSWAITLISTREPORTGET is a good starting point to find these requests, but we might want to make this a function in the waitlist class // if a request cannot be fulfilled in full (ticket type wasn't selected or quantity is no longer available) skip it // if the request can be fulfilled, include it in the matchingRequests array and decrement requested quantity for the section // return the matchingRequests as a json object // $a = json_encode($b); // echo $a; // $a = { // "ticketTypes": { // "557968": { // "section": "235606", // "amount": "1" // }, // "604142": { // "section": "253594", // "amount": "2" // } // }, // "delivery": { // "digitalPrintPass", // "willcall" // } // };

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.0160.00616.38
8.3.50.0040.01120.24
8.3.40.0080.00818.96
8.3.30.0120.00418.75
8.3.20.0050.00324.18
8.3.10.0030.00624.66
8.3.00.0070.00026.16
8.2.180.0070.00725.92
8.2.170.0150.00018.93
8.2.160.0070.01022.96
8.2.150.0030.00625.66
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0090.00022.16
8.2.100.0070.00417.72
8.2.90.0040.00417.49
8.2.80.0000.00818.77
8.2.70.0050.00317.63
8.2.60.0040.00417.63
8.2.50.0080.00017.98
8.2.40.0070.00018.16
8.2.30.0050.00218.13
8.2.20.0040.00420.31
8.2.10.0030.00518.08
8.2.00.0040.00419.18
8.1.280.0140.00025.92
8.1.270.0000.00823.99
8.1.260.0030.00526.35
8.1.250.0050.00228.09
8.1.240.0060.00323.87
8.1.230.0070.00419.00
8.1.220.0040.00418.51
8.1.210.0000.00918.77
8.1.200.0030.00617.48
8.1.190.0030.00517.23
8.1.180.0060.00318.10
8.1.170.0000.00817.62
8.1.160.0020.00518.95
8.1.150.0040.00718.55
8.1.140.0000.00817.45
8.1.130.0030.00318.82
8.1.120.0040.00417.42
8.1.110.0070.00017.44
8.1.100.0030.00517.35
8.1.90.0040.00417.43
8.1.80.0040.00417.40
8.1.70.0030.00517.42
8.1.60.0190.00017.50
8.1.50.0040.00817.45
8.1.40.0070.00317.34
8.1.30.0110.00317.52
8.1.20.0100.00517.52
8.1.10.0110.00217.58
8.1.00.0170.00317.50
8.0.300.0070.00018.77
8.0.290.0000.00816.63
8.0.280.0030.00318.39
8.0.270.0000.00716.82
8.0.260.0030.00318.32
8.0.250.0000.00716.93
8.0.240.0040.00416.85
8.0.230.0030.00316.95
8.0.220.0070.00016.79
8.0.210.0000.00816.91
8.0.200.0120.00316.87
8.0.190.0150.00016.86
8.0.180.0090.00316.70
8.0.170.0080.00816.87
8.0.160.0100.00616.80
8.0.150.0140.00016.85
8.0.140.0130.00316.71
8.0.130.0120.00316.77
8.0.120.0090.00616.80
8.0.110.0130.00316.89
8.0.100.0060.00916.79
8.0.90.0060.00916.77
8.0.80.0130.00316.80
8.0.70.0110.00416.71
8.0.60.0070.00716.72
8.0.50.0100.00516.73
8.0.30.0150.00016.84
8.0.20.0130.00016.86
8.0.10.0070.00716.88
7.4.330.0050.00015.55
7.4.320.0020.00516.61
7.4.300.0000.01116.50
7.4.290.0110.00816.51
7.4.280.0150.00016.57
7.4.270.0130.00516.50
7.4.260.0120.00316.52
7.4.250.0080.00516.48
7.4.240.0080.00816.47
7.4.230.0130.00016.43
7.4.220.0030.01116.49
7.4.210.0100.00316.45
7.4.200.0100.00316.49
7.4.190.0100.00316.68
7.4.180.0050.00916.50
7.4.160.0000.01316.50
7.4.150.0040.00816.44
7.4.140.0130.00016.52
7.4.130.0080.00316.52
7.4.120.0080.00316.33
7.4.110.0070.00416.36
7.4.100.0060.00415.93
7.4.90.0070.00316.26
7.4.80.0030.00716.30
7.4.70.0070.00416.42
7.4.60.0090.00016.34
7.4.50.0050.00516.28
7.4.40.0050.00516.29
7.4.30.0100.00016.31
7.4.20.0050.00516.14
7.4.10.0100.00016.24
7.4.00.0030.00616.06

preferences:
31.64 ms | 400 KiB | 5 Q