3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function reverse($string) { $substr1 = ""; $substr2 = ""; $strLength = strlen($string)-1; for ($i = 0; $i < ($strLength / 2); $i++) { $substr1 += $string[$strLength-$i]; $substr2 += $string[$i]; } return $string = $substr1 + $substr2; } var_dump(reverse('12345'));
based on OT1ST
Output for 7.1.0
Warning: A non-numeric value encountered in /in/7tTNe on line 7 Warning: A non-numeric value encountered in /in/7tTNe on line 8 int(12)
Output for 4.3.0 - 7.0.14
int(12)