3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getImg ($src) { switch ($src) { case "Sunny": echo "<img src='fakepath/sunny.png'>"; break; case "Sad": echo "<img src='fakepath/sad.png'>"; break; case "Smile": echo "<img src='fakepath/smile.png'>"; break; default: echo "nothing"; break; } } $style = "Sad"; getImg($style); $style = 'Sunny'; getImg($style); $style = 'Smile'; getImg($style);
Output for 4.3.0 - 7.1.0
<img src='fakepath/sad.png'><img src='fakepath/sunny.png'><img src='fakepath/smile.png'>