3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function revert($str) { $a = ''; for($i = 0; isset($str{$i}); $i++) { $a = $str{$i} . $a; } return $a; } echo revert('abcdefgh');
Output for 4.3.3 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
hgfedcba
Output for 5.0.0 - 5.0.1
Notice: Uninitialized string offset: 8 in /in/YtRqn on line 7 hgfedcba
Output for 4.3.0 - 4.3.2
Notice: Uninitialized string offset: 8 in /in/YtRqn on line 5 hgfedcba