3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $sentence = 'Frank Sinatra'; echo $sentence . "<br/>\n"; echo removeEveryThirdLetter($sentence); function removeEveryThirdLetter($sentence) { $letters = str_split($sentence); foreach($letters as $key => $letter){ if($key > 0 && ($key+ 1) % 3 === 0){ unset($letters[$key]); } } return implode('', $letters); }
Output for 5.0.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Frank Sinatra<br/> FrnkSiata
Output for 4.4.5 - 4.4.9
Frank Sinatra<br/> Fatal error: Call to undefined function: str_split() in /in/n2CsB on line 8
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Frank Sinatra<br/> Fatal error: Call to undefined function: str_split() in /in/n2CsB on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Frank Sinatra<br/> Fatal error: Call to undefined function: str_split() in /in/n2CsB on line 8