3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=array("a"=>"red","b"=>"green","c"=>"blue"); $found = false; foreach($a as $item) { if($found == false) { preg_match("red",$item); } } echo $found; ?>

preferences:
50.41 ms | 402 KiB | 5 Q