3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $out1 = 'Hello World?'; $end = substr($out1,(strlen($out1)-1),strlen($out1)); if (($end != '.') || ($end != '?') || ($end != '!')) { $out1 = substr($out1, 0, -1).'.'; } echo $out1;
Output for 4.3.0 - 7.1.0
Hello World.