3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a=array("a"=>"red","b"=>"green","c"=>"blue"); $found = false; $string = "red"; foreach($a as $item) { if($found == false) { preg_match("/$string/",$item); } } echo $found; ?>
based on Ntehs
Output for 4.3.0 - 7.2.0