3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function solution($S) { $length = strlen($S); if ($length == 0) { return false; } elseif ($length == 1) { return true; } else { for ( $i=0; $i < strlen($S); $i++) { if (substr($S, $i, 1) == substr($S, $length - $i, 1)) { continue; } else { return false; } } } return true; } echo solution('anavolimilovana'); ?>
Output for 4.3.0 - 7.1.0