3v4l.org

run code in 300+ PHP versions simultaneously
<?php function get_jobs() { return json_decode('[ {"id":"28038a67e70c7e235fa725bbf8b6e167d9e3efee1e43a304d73be8408c6f24a2","posting_job_title":"Entry Level Sales Representative*","job_relationship":"w2_employee","location":"Aston, PA","territory_id":1,"territory_abbr":"PHL"}, {"id":"7f8bcb16e0f3ffe9c8ce9aff2b6033bfbe582241e818aaf9c21506d509e70592","posting_job_title":"Sales Representative*","job_relationship":"w2_employee","location":"Chester, PA","territory_id":1,"territory_abbr":"PHL"}, {"id":"7c6cc1c2abda3dae2edf0982f758073316491b27c240e5fa13df791e0fb5b744","posting_job_title":"Entry Level Sales Representative*","job_relationship":"w2_employee","location":"Aston, PA","territory_id":1,"territory_abbr":"PHL"}, {"id":"556b7ec84be0e6a5130cde5a441dc58ed595de5acd4e5f4883a2b2e6cc5eb4f4","posting_job_title":"Siding Subcontractors Needed- Up To $10,000 SIGN ON BONUS","job_relationship":"company","location":"Essex, MD","territory_id":3,"territory_abbr":"MD"}, {"id":"31f1752e8c3f1086b4a1ed499e8786e1d15a8d1825cb75848056333d1cae8276","posting_job_title":"Entry Level Sales Representative*","job_relationship":"w2_employee","location":"Bridgewater, NJ","territory_id":2,"territory_abbr":"NJ"}, {"id":"197c35000fb9b9ca1fe71771bb618c5443f0e7e51b59b9cad22f08d77d73de54","posting_job_title":"Siding Subcontractors Needed- Up To $10,000 SIGN ON BONUS","job_relationship":"company","location":"Aberdeen, MD","territory_id":3,"territory_abbr":"MD"}, {"id":"8621ae18266b571175358113fd3ed7147f2ffa7d248c71c8e1a78b566ac24628","posting_job_title":"Sales Representative*","job_relationship":"w2_employee","location":"Bronx, NY","territory_id":4,"territory_abbr":"CT"}, {"id":"bc2f7034687d2273f14bb2fa41fef8472f5e12ce8e483210b628167bba09c9aa","posting_job_title":"Sales Representative*","job_relationship":"w2_employee","location":"Greenwich, CT","territory_id":4,"territory_abbr":"CT"}, {"id":"5debdc91afd45080a7cb87912b9411f186793e3ad9be8fbf8fe7f40f85ce9d17","posting_job_title":"Entry Level Sales Representative*","job_relationship":"w2_employee","location":"Bayside, NY","territory_id":5,"territory_abbr":"LI"}, {"id":"3dc256cecd93030f3d4079b5a313277cc03f92fb2d991cf9b0b656a34f84425f","posting_job_title":"Entry Level Sales Representative*","job_relationship":"w2_employee","location":"Bayside, NY","territory_id":5,"territory_abbr":"LI"}, {"id":"8121cb7efb0e04130fbdc3f69468c7434c1582f71d71408ef689b81519d86a5c","posting_job_title":"Siding Subcontractors Needed- Up To $10,000 SIGN ON BONUS","job_relationship":"company","location":"Parkville, MD","territory_id":3,"territory_abbr":"MD"}, {"id":"269e4edc7ed745210c71e8b324a5f2f559ba793f1ff67d5e61b00ee48b992d89","posting_job_title":"Sales Representative*","job_relationship":"w2_employee","location":"Bayside, NY","territory_id":5,"territory_abbr":"LI"} ]', true); } function display_jobs() { $jobs = get_jobs(); usort($jobs, fn($a, $b) => $a['territory_id'] <=> $b['territory_id'] ?: $a['location'] <=> $b['location'] ); $groups = []; foreach ($jobs as $posting) { $groups[$posting['territory_abbr']][$posting['location']][] = $posting; } $html = ''; foreach ($groups as $terrAbbr => $locations) { $html .= <<<HTML <div style="border: solid 1px orange;"> <h3>$terrAbbr</h3> HTML; foreach ($locations as $locName => $postings) { $html .= <<<HTML <div style="border: solid 1px blue;"> <h4>$locName</h4> HTML; foreach ($postings as $posting) { $html .= sprintf(<<<HTML <div style="border: solid 1px green;"> <ul class="col"> <li>%s</li> <li>%s</li> <li>%s</li> <li>%s</li> <li>%s</li> <li>%s</li> </ul> </div> HTML, $posting['territory_abbr'], $posting['territory_id'], $posting['location'], $posting['id'], $posting['posting_job_title'], $posting['job_relationship'] ); } $html .= <<<HTML </div> HTML; } $html .= <<<HTML </div> HTML; } $html = $html ?: 'No data'; return <<<HTML <div style="border: solid 1px red;"> $html </div> HTML; } echo display_jobs();

Abusive script

This script was stopped while abusing our resources

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.110.0130.00922.52
8.4.100.0110.00818.98
8.4.90.0080.01318.79
8.4.80.0140.00618.89
8.4.70.0120.00817.99
8.4.60.0120.01019.05
8.4.50.0120.00817.59
8.4.40.0060.00319.38
8.4.30.0200.00020.45
8.4.20.0190.00022.45
8.4.10.0040.00722.12
8.3.240.0120.00717.44
8.3.230.0120.00817.04
8.3.220.0060.00319.20
8.3.210.0070.01416.87
8.3.200.0030.00616.96
8.3.190.0130.00617.37
8.3.180.0110.00718.36
8.3.170.0050.00318.99
8.3.160.0150.00417.18
8.3.150.0100.00718.93
8.3.140.0120.00620.70
8.3.130.0040.00418.50
8.3.120.0090.00018.91
8.3.110.0030.00620.94
8.3.100.0080.00024.06
8.3.90.0090.00926.77
8.3.80.0060.00317.97
8.3.70.0070.00718.68
8.3.60.0160.00018.55
8.3.50.0070.00716.56
8.3.40.0040.01120.52
8.3.30.0110.00418.79
8.3.20.0080.00024.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.290.0120.00520.21
8.2.280.0100.00920.45
8.2.270.0000.01817.19
8.2.260.0120.00616.62
8.2.250.0040.00418.48
8.2.240.0080.00017.20
8.2.230.0040.00722.58
8.2.220.0060.00337.54
8.2.210.0070.00726.77
8.2.200.0060.00316.88
8.2.190.0100.00716.88
8.2.180.0120.00916.50
8.2.170.0040.01119.08
8.2.160.0030.01022.96
8.2.150.0090.00025.66
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0070.00726.16
8.2.110.0060.00322.15
8.2.100.0040.00818.03
8.2.90.0090.00017.88
8.2.80.0080.00318.83
8.2.70.0030.00517.75
8.2.60.0040.00418.18
8.2.50.0030.00518.07
8.2.40.0000.00920.01
8.2.30.0000.00818.16
8.2.20.0080.00019.50
8.2.10.0180.00017.77
8.2.00.0160.00617.87
8.1.330.0100.00822.22
8.1.320.0140.00516.26
8.1.310.0150.00016.27
8.1.300.0030.01616.97
8.1.290.0000.00930.84
8.1.280.0110.00725.92
8.1.270.0040.00424.66
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00923.77
8.1.230.0040.00721.10
8.1.220.0030.00617.89
8.1.210.0000.00918.77
8.1.200.0090.00317.61
8.1.190.0040.00417.47
8.1.180.0020.00522.20
8.1.170.0040.00419.03
8.1.160.0040.00418.90
8.1.150.0000.00818.78
8.1.140.0170.00017.58
8.1.130.0150.00417.45
8.1.120.0140.00317.51
8.1.110.0090.00917.50
8.1.100.0120.00617.58
8.1.90.0070.01017.60
8.1.80.0190.00017.56
8.1.70.0040.00817.50
8.1.60.0170.00517.76
8.1.50.0100.01417.66
8.1.40.0150.00717.68
8.1.30.0210.00017.79
8.1.20.0150.00617.79
8.1.10.0210.00017.61
8.1.00.0160.00317.61
8.0.300.0000.00718.81
8.0.290.0040.00416.75
8.0.280.0070.00018.52
8.0.270.0130.00416.84
8.0.260.0200.00017.01
8.0.250.0100.00717.03
8.0.240.0130.00316.98
8.0.230.0120.00417.01
8.0.220.0110.00416.87
8.0.210.0120.00416.86
8.0.200.0130.00316.90
8.0.190.0140.00517.00
8.0.180.0160.00017.00
8.0.170.0140.00316.94
8.0.160.0120.00316.88
8.0.150.0150.00016.88
8.0.140.0120.00217.01
8.0.130.0140.00416.94
8.0.120.0100.00716.92
8.0.110.0080.00816.95
8.0.100.0180.00016.86
8.0.90.0080.00816.90
8.0.80.0060.00916.86
8.0.70.0140.00516.93
8.0.60.0080.00816.82
8.0.50.0140.00516.94
8.0.30.0090.00916.95
8.0.20.0170.00016.89
8.0.10.0110.00617.08

preferences:
28.36 ms | 403 KiB | 5 Q