3v4l.org

run code in 300+ PHP versions simultaneously
<?php solution($S) { $length = 0; 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 5.3.0 - 5.3.28, 5.4.0 - 5.4.29
Parse error: syntax error, unexpected '{' in /in/SM0CW on line 2
Process exited with code 255.

preferences:
181.98 ms | 1386 KiB | 66 Q