3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a=array("a"=>"red","b"=>"green","c"=>"blue"); $found = false; foreach($a as $item) { if($found == false) { preg_match("red",$item); } } echo $found; ?>
based on rBlUR
Output for 4.3.11 - 7.1.0
Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /in/Ntehs on line 7 Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /in/Ntehs on line 7 Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /in/Ntehs on line 7
Output for 4.3.0 - 4.3.10
Warning: Delimiter must not be alphanumeric or backslash in /in/Ntehs on line 7 Warning: Delimiter must not be alphanumeric or backslash in /in/Ntehs on line 7 Warning: Delimiter must not be alphanumeric or backslash in /in/Ntehs on line 7