3v4l.org

run code in 300+ PHP versions simultaneously
<?php $food = array('fruits' => array('item1'=>'orange', 'item2'=>'banana', 'item3'=>'apple'), 'veggie' => array('item1'=>'carrot', 'item2'=>'collard', 'item3'=>'pea')); print_r($food); foreach($food as $item) { echo $item["item1"]."<br >"; } if(in_array('orange', $food, true)){ echo 'in array'; } else { echo 'not in array'; } $test_array=null; echo count($test_array)."count of food "; echo strlen("");

preferences:
51.23 ms | 402 KiB | 5 Q