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

Output for git.master, git.master_jit, rfc.property-hooks
<div style="border: solid 1px red;"> <div style="border: solid 1px orange;"> <h3>PHL</h3> <div style="border: solid 1px blue;"> <h4>Aston, PA</h4> <div style="border: solid 1px green;"> <ul class="col"> <li>PHL</li> <li>1</li> <li>Aston, PA</li> <li>28038a67e70c7e235fa725bbf8b6e167d9e3efee1e43a304d73be8408c6f24a2</li> <li>Entry Level Sales Representative*</li> <li>w2_employee</li> </ul> </div> <div style="border: solid 1px green;"> <ul class="col"> <li>PHL</li> <li>1</li> <li>Aston, PA</li> <li>7c6cc1c2abda3dae2edf0982f758073316491b27c240e5fa13df791e0fb5b744</li> <li>Entry Level Sales Representative*</li> <li>w2_employee</li> </ul> </div> </div> <div style="border: solid 1px blue;"> <h4>Chester, PA</h4> <div style="border: solid 1px green;"> <ul class="col"> <li>PHL</li> <li>1</li> <li>Chester, PA</li> <li>7f8bcb16e0f3ffe9c8ce9aff2b6033bfbe582241e818aaf9c21506d509e70592</li> <li>Sales Representative*</li> <li>w2_employee</li> </ul> </div> </div> </div> <div style="border: solid 1px orange;"> <h3>NJ</h3> <div style="border: solid 1px blue;"> <h4>Bridgewater, NJ</h4> <div style="border: solid 1px green;"> <ul class="col"> <li>NJ</li> <li>2</li> <li>Bridgewater, NJ</li> <li>31f1752e8c3f1086b4a1ed499e8786e1d15a8d1825cb75848056333d1cae8276</li> <li>Entry Level Sales Representative*</li> <li>w2_employee</li> </ul> </div> </div> </div> <div style="border: solid 1px orange;"> <h3>MD</h3> <div style="border: solid 1px blue;"> <h4>Aberdeen, MD</h4> <div style="border: solid 1px green;"> <ul class="col"> <li>MD</li> <li>3</li> <li>Aberdeen, MD</li> <li>197c35000fb9b9ca1fe71771bb618c5443f0e7e51b59b9cad22f08d77d73de54</li> <li>Siding Subcontractors Needed- Up To $10,000 SIGN ON BONUS</li> <li>company</li> </ul> </div> </div> <div style="border: solid 1px blue;"> <h4>Essex, MD</h4> <div style="border: solid 1px green;"> <ul class="col"> <li>MD</li> <li>3</li> <li>Essex, MD</li> <li>556b7ec84be0e6a5130cde5a441dc58ed595de5acd4e5f4883a2b2e6cc5eb4f4</li> <li>Siding Subcontractors Needed- Up To $10,000 SIGN ON BONUS</li> <li>company</li> </ul> </div> </div> <div style="border: solid 1px blue;"> <h4>Parkville, MD</h4> <div style="border: solid 1px green;"> <ul class="col"> <li>MD</li> <li>3</li> <li>Parkville, MD</li> <li>8121cb7efb0e04130fbdc3f69468c7434c1582f71d71408ef689b81519d86a5c</li> <li>Siding Subcontractors Needed- Up To $10,000 SIGN ON BONUS</li> <li>company</li> </ul> </div> </div> </div> <div style="border: solid 1px orange;"> <h3>CT</h3> <div style="border: solid 1px blue;"> <h4>Bronx, NY</h4> <div style="border: solid 1px green;"> <ul class="col"> <li>CT</li> <li>4</li> <li>Bronx, NY</li> <li>8621ae18266b571175358113fd3ed7147f2ffa7d248c71c8e1a78b566ac24628</li> <li>Sales Representative*</li> <li>w2_employee</li> </ul> </div> </div> <div style="border: solid 1px blue;"> <h4>Greenwich, CT</h4> <div style="border: solid 1px green;"> <ul class="col"> <li>CT</li> <li>4</li> <li>Greenwich, CT</li> <li>bc2f7034687d2273f14bb2fa41fef8472f5e12ce8e483210b628167bba09c9aa</li> <li>Sales Representative*</li> <li>w2_employee</li> </ul> </div> </div> </div> <div style="border: solid 1px orange;"> <h3>LI</h3> <div style="border: solid 1px blue;"> <h4>Bayside, NY</h4> <div style="border: solid 1px green;"> <ul class="col"> <li>LI</li> <li>5</li> <li>Bayside, NY</li> <li>5debdc91afd45080a7cb87912b9411f186793e3ad9be8fbf8fe7f40f85ce9d17</li> <li>Entry Level Sales Representative*</li> <li>w2_employee</li> </ul> </div> <div style="border: solid 1px green;"> <ul class="col"> <li>LI</li> <li>5</li> <li>Bayside, NY</li> <li>3dc256cecd93030f3d4079b5a313277cc03f92fb2d991cf9b0b656a34f84425f</li> <li>Entry Level Sales Representative*</li> <li>w2_employee</li> </ul> </div> <div style="border: solid 1px green;"> <ul class="col"> <li>LI</li> <li>5</li> <li>Bayside, NY</li> <li>269e4edc7ed745210c71e8b324a5f2f559ba793f1ff67d5e61b00ee48b992d89</li> <li>Sales Representative*</li> <li>w2_employee</li> </ul> </div> </div> </div> </div>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
31.86 ms | 429 KiB | 5 Q