3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //$favcolor=array('"red",','"blue"'); //$arr=array(print_r (array_values( $favcolor))); //rint_r (array_values( $arr)); $arrR=array("red","blue"); $QW=in_array("red",$arrR); $QA=in_array("blue",$arrR); if ($QW+$QA>1) { $QW="TRUE";} else{$QW="FALSE";}; ECHO $QW; switch ($QW) { case "TRUE": echo "Your favorite color is red!"; case "TRUE": echo "Your favorite color is blue!"; case "FALSE": echo "Your favorite color is green!"; break; default: echo "Your favorite color is neither red, blue, or green!"; } ?>
Output for 4.3.0 - 7.1.0
TRUEYour favorite color is red!Your favorite color is blue!Your favorite color is green!