3v4l.org

run code in 300+ PHP versions simultaneously
<?php $categories = array( array( "id" => 1, "title" => "Обувь", 'children' => array( array( 'id' => 2, 'title' => 'Ботинки', 'children' => array( array('id' => 3, 'title' => 'Кожа'), array('id' => 4, 'title' => 'Текстиль'), ), ), array('id' => 5, 'title' => 'Кроссовки',), )), array( "id" => 6, "title" => "Спорт", 'children' => array( array( 'id' => 7, 'title' => 'Мячи' ) ) ), ); function searchCategory($categories, $id) { foreach($categories as $category) { if($category['id'] == $id) echo $category['title'] . '<br>'; if(isset($category['children'])) searchCategory($category['children'],$id); } }; searchCategory($categories,4);
Output for git.master, git.master_jit, rfc.property-hooks
Текстиль<br>

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