3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rows = array(array(1, 'Ana Sayfa', '#', 0, 1), array(2, 'Tutorials', '#', 0, 1), array(3, 'Java', 'java', 6, 1), array(4, 'Liferay', 'liferay', 3, 1), array(5, 'Frameworks', '#', 0, 1), array(6, 'JSF', 'jsf', 5, 1), array(7, 'Struts', 'struts', 5, 1), array(8, 'Spring', 'spring', 6, 1), array(9, 'Hibernate', 'hibernate', 6, 1), array(10, 'Webservices', '#', 0, 1), array(11, 'REST', 'rest', 10, 1), array(12, 'SOAP', 'soap', 10, 1), array(13, 'Contact', 'contact', 0, 1), array(14, 'About', 'about', 0, 1), array(15, 'TEST-TEST-TEST', 'test', 5, 1), array(16, 'TEST2', 'test2', 15, 1)); foreach ($rows as $row) { $items[] = array_combine(array('cat_id', 'cat_name', 'seo_url', 'parent_id', 'place'), $row); } function draw_menu($items, $parent_id) { echo "\n<ul>\n"; foreach ($items as $item) { if ($item['parent_id'] == $parent_id) { echo "<li>" . $item['cat_name']; // any children? if (count(array_keys(array_column($items, 'parent_id'), $item['cat_id']))) { draw_menu($items, $item['cat_id']); } echo "</li>\n"; } } echo "</ul>\n"; } draw_menu($items, 0);
Output for git.master, git.master_jit, rfc.property-hooks
<ul> <li>Ana Sayfa</li> <li>Tutorials</li> <li>Frameworks <ul> <li>JSF <ul> <li>Java <ul> <li>Liferay</li> </ul> </li> <li>Spring</li> <li>Hibernate</li> </ul> </li> <li>Struts</li> <li>TEST-TEST-TEST <ul> <li>TEST2</li> </ul> </li> </ul> </li> <li>Webservices <ul> <li>REST</li> <li>SOAP</li> </ul> </li> <li>Contact</li> <li>About</li> </ul>

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:
63.64 ms | 406 KiB | 5 Q