3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function longest_palendrome($string) { $words = split(' ', $string); $longest = ''; foreach ($words as $word) { $letters = $reversed = split($word); array_reverse($reversed); if ($letters === join($reversed) && strlen($word) > strlen($longest)) { $longest = $word; } } return $word; } echo longest_palendrome("i ama racecar");
Output for 7.0.0 - 7.1.0RC5
Fatal error: Uncaught Error: Call to undefined function split() in /in/4QHue:4 Stack trace: #0 /in/4QHue(17): longest_palendrome('i ama racecar') #1 {main} thrown in /in/4QHue on line 4
Process exited with code 255.
Output for hhvm-3.10.0 - 3.13.2
Warning: split() expects at least 2 parameters, 1 given in /in/4QHue on line 7 Warning: array_reverse() expects parameter 1 to be array, null given in /in/4QHue on line 8 Warning: Invalid operand type was used: implode() expects a container as one of the arguments in /in/4QHue on line 9 Warning: split() expects at least 2 parameters, 1 given in /in/4QHue on line 7 Warning: array_reverse() expects parameter 1 to be array, null given in /in/4QHue on line 8 Warning: Invalid operand type was used: implode() expects a container as one of the arguments in /in/4QHue on line 9 Warning: split() expects at least 2 parameters, 1 given in /in/4QHue on line 7 Warning: array_reverse() expects parameter 1 to be array, null given in /in/4QHue on line 8 Warning: Invalid operand type was used: implode() expects a container as one of the arguments in /in/4QHue on line 9 racecar
Output for 5.3.0 - 5.6.26
Deprecated: Function split() is deprecated in /in/4QHue on line 4 Deprecated: Function split() is deprecated in /in/4QHue on line 7 Warning: split() expects at least 2 parameters, 1 given in /in/4QHue on line 7 Warning: array_reverse() expects parameter 1 to be array, null given in /in/4QHue on line 8 Warning: join(): Argument must be an array in /in/4QHue on line 9 Deprecated: Function split() is deprecated in /in/4QHue on line 7 Warning: split() expects at least 2 parameters, 1 given in /in/4QHue on line 7 Warning: array_reverse() expects parameter 1 to be array, null given in /in/4QHue on line 8 Warning: join(): Argument must be an array in /in/4QHue on line 9 Deprecated: Function split() is deprecated in /in/4QHue on line 7 Warning: split() expects at least 2 parameters, 1 given in /in/4QHue on line 7 Warning: array_reverse() expects parameter 1 to be array, null given in /in/4QHue on line 8 Warning: join(): Argument must be an array in /in/4QHue on line 9 racecar
Output for 5.2.5 - 5.2.17
Warning: Wrong parameter count for split() in /in/4QHue on line 7 Warning: array_reverse(): The argument should be an array in /in/4QHue on line 8 Warning: join(): Argument must be an array in /in/4QHue on line 9 Warning: Wrong parameter count for split() in /in/4QHue on line 7 Warning: array_reverse(): The argument should be an array in /in/4QHue on line 8 Warning: join(): Argument must be an array in /in/4QHue on line 9 Warning: Wrong parameter count for split() in /in/4QHue on line 7 Warning: array_reverse(): The argument should be an array in /in/4QHue on line 8 Warning: join(): Argument must be an array in /in/4QHue on line 9 racecar
Output for 4.3.2 - 5.2.4
Warning: Wrong parameter count for split() in /in/4QHue on line 7 Warning: array_reverse(): The argument should be an array in /in/4QHue on line 8 Warning: join(): Argument to implode must be an array. in /in/4QHue on line 9 Warning: Wrong parameter count for split() in /in/4QHue on line 7 Warning: array_reverse(): The argument should be an array in /in/4QHue on line 8 Warning: join(): Argument to implode must be an array. in /in/4QHue on line 9 Warning: Wrong parameter count for split() in /in/4QHue on line 7 Warning: array_reverse(): The argument should be an array in /in/4QHue on line 8 Warning: join(): Argument to implode must be an array. in /in/4QHue on line 9 racecar
Output for 4.3.0 - 4.3.1
Warning: Wrong parameter count for split() in /in/4QHue on line 7 Warning: array_reverse() [http://www.php.net/function.array-reverse]: The argument should be an array in /in/4QHue on line 8 Warning: join() [http://www.php.net/function.join]: Argument to implode must be an array. in /in/4QHue on line 9 Warning: Wrong parameter count for split() in /in/4QHue on line 7 Warning: array_reverse() [http://www.php.net/function.array-reverse]: The argument should be an array in /in/4QHue on line 8 Warning: join() [http://www.php.net/function.join]: Argument to implode must be an array. in /in/4QHue on line 9 Warning: Wrong parameter count for split() in /in/4QHue on line 7 Warning: array_reverse() [http://www.php.net/function.array-reverse]: The argument should be an array in /in/4QHue on line 8 Warning: join() [http://www.php.net/function.join]: Argument to implode must be an array. in /in/4QHue on line 9 racecar