3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = array( (object) array("term_id"=>"","name"=>"Research and Development","slug"=>"Public Relations","term_group"=>5,"term_taxonomy_id"=>9,"taxonomy"=>"Myanmar","description"=>"69509","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Public Relations","slug"=>"Media Relations","term_group"=>5,"term_taxonomy_id"=>7,"taxonomy"=>"Belgium","description"=>"14234","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Advertising","slug"=>"Quality Assurance","term_group"=>5,"term_taxonomy_id"=>1,"taxonomy"=>"Norfolk Island","description"=>"93236","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Finances","slug"=>"Legal Department","term_group"=>5,"term_taxonomy_id"=>5,"taxonomy"=>"Honduras","description"=>"74759","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Legal Department","slug"=>"Media Relations","term_group"=>1,"term_taxonomy_id"=>9,"taxonomy"=>"Namibia","description"=>"69625","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Sales and Marketing","slug"=>"Advertising","term_group"=>2,"term_taxonomy_id"=>4,"taxonomy"=>"Syria","description"=>"56469","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Finances","slug"=>"Media Relations","term_group"=>5,"term_taxonomy_id"=>8,"taxonomy"=>"Ethiopia","description"=>"74909","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Media Relations","slug"=>"Asset Management","term_group"=>5,"term_taxonomy_id"=>9,"taxonomy"=>"Indonesia","description"=>"17623","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Finances","slug"=>"Customer Relations","term_group"=>2,"term_taxonomy_id"=>3,"taxonomy"=>"Zimbabwe","description"=>"83249","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Sales and Marketing","slug"=>"Public Relations","term_group"=>1,"term_taxonomy_id"=>10,"taxonomy"=>"Faroe Islands","description"=>"03778","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Sales and Marketing","slug"=>"Sales and Marketing","term_group"=>7,"term_taxonomy_id"=>3,"taxonomy"=>"Latvia","description"=>"68525","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Accounting","slug"=>"Research and Development","term_group"=>9,"term_taxonomy_id"=>7,"taxonomy"=>"Bouvet Island","description"=>"18959","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Asset Management","slug"=>"Advertising","term_group"=>1,"term_taxonomy_id"=>9,"taxonomy"=>"Tajikistan","description"=>"94796","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Tech Support : arstatf","slug"=>"Accounting","term_group"=>5,"term_taxonomy_id"=>7,"taxonomy"=>"Côte D'Ivoire (Ivory Coast)","description"=>"24209","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Research and Development","slug"=>"Human Resources","term_group"=>9,"term_taxonomy_id"=>3,"taxonomy"=>"Ukraine","description"=>"77647","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Media Relations","slug"=>"Customer Service","term_group"=>6,"term_taxonomy_id"=>7,"taxonomy"=>"Maldives","description"=>"97264","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Sales and Marketing","slug"=>"Public Relations","term_group"=>4,"term_taxonomy_id"=>1,"taxonomy"=>"Burundi","description"=>"15271","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Customer Service","slug"=>"Public Relations","term_group"=>9,"term_taxonomy_id"=>7,"taxonomy"=>"Sierra Leone","description"=>"41278","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Advertising","slug"=>"Advertising","term_group"=>10,"term_taxonomy_id"=>2,"taxonomy"=>"Guatemala","description"=>"65945","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Media Relations","slug"=>"Public Relations","term_group"=>4,"term_taxonomy_id"=>6,"taxonomy"=>"Taiwan","description"=>"06924","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Payroll","slug"=>"Payroll","term_group"=>3,"term_taxonomy_id"=>2,"taxonomy"=>"Niue","description"=>"58151","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Sales and Marketing","slug"=>"Customer Relations","term_group"=>4,"term_taxonomy_id"=>1,"taxonomy"=>"Lebanon","description"=>"07714","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Customer Service","slug"=>"Media Relations","term_group"=>10,"term_taxonomy_id"=>8,"taxonomy"=>"Philippines","description"=>"49467","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Sales and Marketing","slug"=>"Quality Assurance","term_group"=>5,"term_taxonomy_id"=>4,"taxonomy"=>"Samoa","description"=>"43176","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Media Relations","slug"=>"Legal Department","term_group"=>7,"term_taxonomy_id"=>1,"taxonomy"=>"Samoa","description"=>"71923","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Customer Relations","slug"=>"Customer Relations","term_group"=>9,"term_taxonomy_id"=>4,"taxonomy"=>"Libya","description"=>"28065","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Accounting","slug"=>"Customer Service","term_group"=>1,"term_taxonomy_id"=>3,"taxonomy"=>"Kazakhstan","description"=>"34833","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Asset Management","slug"=>"Finances","term_group"=>4,"term_taxonomy_id"=>7,"taxonomy"=>"Gibraltar","description"=>"89643","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Advertising","slug"=>"Payroll","term_group"=>8,"term_taxonomy_id"=>2,"taxonomy"=>"Togo","description"=>"89307","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Customer Relations","slug"=>"Quality Assurance","term_group"=>2,"term_taxonomy_id"=>6,"taxonomy"=>"Ukraine","description"=>"18751","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Research and Development","slug"=>"Asset Management","term_group"=>4,"term_taxonomy_id"=>9,"taxonomy"=>"El Salvador","description"=>"22852","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Tech Support : arstatf","slug"=>"Accounting","term_group"=>8,"term_taxonomy_id"=>1,"taxonomy"=>"Guatemala","description"=>"74218","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Asset Management","slug"=>"Research and Development","term_group"=>7,"term_taxonomy_id"=>5,"taxonomy"=>"Taiwan","description"=>"21287","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Finances","slug"=>"Tech Support-rstartawt","term_group"=>10,"term_taxonomy_id"=>8,"taxonomy"=>"Fiji","description"=>"90444","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Payroll","slug"=>"Customer Relations","term_group"=>4,"term_taxonomy_id"=>3,"taxonomy"=>"Barbados","description"=>"33922","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Quality Assurance","slug"=>"Tech Support-rstartawt","term_group"=>3,"term_taxonomy_id"=>5,"taxonomy"=>"Aruba","description"=>"25744","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Quality Assurance","slug"=>"Finances","term_group"=>5,"term_taxonomy_id"=>2,"taxonomy"=>"Haiti","description"=>"46402","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Research and Development","slug"=>"Customer Relations","term_group"=>5,"term_taxonomy_id"=>3,"taxonomy"=>"Zambia","description"=>"34822","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Research and Development","slug"=>"Customer Relations","term_group"=>10,"term_taxonomy_id"=>10,"taxonomy"=>"Myanmar","description"=>"86888","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Customer Service","slug"=>"Finances","term_group"=>1,"term_taxonomy_id"=>7,"taxonomy"=>"Palau","description"=>"07942","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Asset Management","slug"=>"Research and Development","term_group"=>1,"term_taxonomy_id"=>7,"taxonomy"=>"Palestine, State of","description"=>"03933","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Tech Support : arstatf","slug"=>"Accounting","term_group"=>9,"term_taxonomy_id"=>4,"taxonomy"=>"Saudi Arabia","description"=>"91924","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Media Relations","slug"=>"Finances","term_group"=>5,"term_taxonomy_id"=>3,"taxonomy"=>"Serbia","description"=>"29202","parent"=>"","count"=>"1"), (object) array("term_id"=>"","name"=>"Accounting","slug"=>"Media Relations","term_group"=>4,"term_taxonomy_id"=>1,"taxonomy"=>"Iran","description"=>"89739","parent"=>"","count"=>"1") ); // organize each category name by type of category eg section, country foreach ($cats as $data) { if ( stripos($cat->name, 'section') !== false ) { $cat->description = str_ireplace("section: ", '', $cat->name); $sections[] = $cat ; } elseif ( stripos($cat->name, 'country') !== false ) { $countries[] = $cat ; $cat->description = str_ireplace("country: ", '', $cat->name); } //etc // put them all in that big array defind earlier $filtered_categories = array('sections' =>$sections, 'countries' => $countries, 'date' => $date, /* 'type' =>$type, */ /*'venues' => $venues,*/ 'alphabetical' => $alphabetical); } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $cats in /in/gnvhX on line 53 Warning: foreach() argument must be of type array|object, null given in /in/gnvhX on line 53

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:
56.29 ms | 401 KiB | 8 Q