3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = "racecar"; $pal = ""; for($a=0; $a<strlen($str); $a++) { for($z=0; $z<strlen($str); $z++) { $subs = substr($str, $a, $z); if( $subs == strrev($subs) and strlen($subs) > strlen($pal) ) { echo $a; $pal = $subs; } } } echo $pal;
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
01aceca