3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ["hen" => "egg", "cow" => "milk", "tree" => "fruit"]; $s = "The hen, cow and tree flourished, all three!"; $s=str_replace($arr,$s); echo $s;

preferences:
42.87 ms | 402 KiB | 5 Q