3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A1 { public function rows() { $a = array(); $a[] = array('parent_id', 0, 'category_id', 7); $a[] = array('parent_id', 0, 'category_id', 8); $a[] = array('parent_id', 0, 'category_id', 9); $a[] = array('parent_id', 7, 'category_id', 10); $a[] = array('parent_id', 7, 'category_id', 11); $a[] = array('parent_id', 8, 'category_id', 12); $a[] = array('parent_id', 10, 'category_id', 13); } } /* foreach($query->rows() as $row) { if(isset($categoryArray[$row['category_id']])) { $categoryArray[$row['parent_id']] = $row['category_id']; } else { $categoryArray[$row['parent_id']][$row['category_id']] = $row['name']; } } */ $query = new A1; $a = $query->rows(); print_r($a);
Output for git.master, git.master_jit, rfc.property-hooks

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