3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function reverse($string) { $substr1 = ""; $substr2 = ""; $strLength = strlen($string); for ($i = 0; $i < ($strLength / 2); $i++) { $substr1 .= $string[$strLength-$i]; $substr2 .= $string[$i]; } //var_dump($substr1); //var_dump($substr2); return $string = $substr1.$substr2; } var_dump(reverse('12345'));
based on tRu89
Output for 5.2.10 - 7.1.0
Notice: Uninitialized string offset: 5 in /in/06jQB on line 7 string(5) "54123"
Output for 4.3.0 - 5.2.9
Notice: Uninitialized string offset: 5 in /in/06jQB on line 7 string(5) "54123"