3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //$search = htmlentities(phpinfo%2528%2529%253B%2523%257Capple%252Fe%2500); echo $search; if (strpos($search, 'apple') !== false){ echo preg_replace("/".$search."/", $search." <img src='".$search.".png'>", "apple"); }elseif (strpos($search, 'orange') !== false){ echo preg_replace("/".$search."/", $search." <img src='".$search.".png'>", "orange"); }elseif (strpos($search, 'banana') !== false){ echo preg_replace("/".$search."/", $search." <img src='".$search.".png'>", "banana"); }elseif (strpos($search, 'kiwi') !== false){ echo preg_replace("/".$search."/", $search." <img src='".$search.".png'>", "kiwi"); }else echo "Please search for apple, orange, banana, or kiwi.";
based on UtsDv
Output for 5.0.4 - 7.1.0
Notice: Undefined variable: search in /in/sEjhv on line 3 Notice: Undefined variable: search in /in/sEjhv on line 4 Notice: Undefined variable: search in /in/sEjhv on line 6 Notice: Undefined variable: search in /in/sEjhv on line 8 Notice: Undefined variable: search in /in/sEjhv on line 10 Please search for apple, orange, banana, or kiwi.
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: search in /in/sEjhv on line 3 Notice: Undefined variable: search in /in/sEjhv on line 4 Notice: Undefined variable: search in /in/sEjhv on line 6 Notice: Undefined variable: search in /in/sEjhv on line 8 Notice: Undefined variable: search in /in/sEjhv on line 10 Please search for apple, orange, banana, or kiwi.