3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); $string = 'JavaSCRIPT and pHp are testing test-ground for TEST !'; $censor = ['php' => 2,'javascript' => 2,'test' => 3]; foreach ($censor as $word => $position) { while (($pos = stripos($string, $word)) !== false) { $string = substr_replace($string, '*', $pos + $position - 1, 1); } } echo $string; $end = (microtime(true)); echo '<br />'; echo $end - $start;

preferences:
38.75 ms | 402 KiB | 5 Q