3v4l.org

run code in 300+ PHP versions simultaneously
<?php function multi_array_search($search_for, $search_in) { foreach ($search_in as $element) { echo "searching " . json_encode($element) . "\n"; if ( ($element === $search_for) ){ return true; }elseif(is_array($element)){ $result = multi_array_search($search_for, $element); if($result == true) return true; } } return false; } $my_array = array( 0 => array( "name" => "john", "id" => 4 ), 1 => array( "name" => "mark", "id" => 152 ), 2 => array( "name" => "Eduard", "id" => 152 ) ); echo multi_array_search(152, $my_array) ? 'Found' : 'Not found';
Output for git.master, git.master_jit, rfc.property-hooks
searching {"name":"john","id":4} searching "john" searching 4 searching {"name":"mark","id":152} searching "mark" searching 152 Found

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