3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = 'world cup'; $arr = explode("\n",$test); $C= new stdClass(); $C->AUTO_HASHTAG = $arr; $myarr = array("world cup"); foreach($myarr as &$ht){ if(strpos($ht,'o')!==false) $myarr[] = str_replace('o','O',$ht); if(strpos($ht,'O')!==false) $myarr[] = str_replace('O','o',$ht); } var_export($myarr);

preferences:
27.39 ms | 402 KiB | 5 Q