3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function replacelist($thetext) { $seachfor = array("crackers","soup"); $replacewith = array("shapes","stew"); $newtext = str_replace($searchfor, $replacewith, $thetext); return $newtext." - plus some test text"; } $mytext="Animal crackers in my soup"; $newphrase = replacelist($mytext); echo $newphrase;
Output for 5.0.4 - 7.2.0
Notice: Undefined variable: searchfor in /in/Prsah on line 6 Notice: Array to string conversion in /in/Prsah on line 6 Animal crackers in my soup - plus some test text
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: searchfor in /in/Prsah on line 6 Notice: Array to string conversion in /in/Prsah on line 6 Animal crackers in my soup - plus some test text