3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $string = 'ABCD'; $offset = 0; $output = ''; while (isset($string[$offset])) $offset++; for ($i = $offset; $i > 0; $i--) { echo "(" . $string . ":" . $offset . ")\n"; $output .= $string[$offset -1]; } echo $string;
based on Q99bE
Output for 4.3.3 - 4.4.9, 5.0.2 - 7.2.0
(ABCD:4) (ABCD:4) (ABCD:4) (ABCD:4) ABCD
Output for 5.0.0 - 5.0.1
(ABCD:5) Notice: Uninitialized string offset: 4 in /in/lGJVs on line 11 (ABCD:5) Notice: Uninitialized string offset: 4 in /in/lGJVs on line 11 (ABCD:5) Notice: Uninitialized string offset: 4 in /in/lGJVs on line 11 (ABCD:5) Notice: Uninitialized string offset: 4 in /in/lGJVs on line 11 (ABCD:5) Notice: Uninitialized string offset: 4 in /in/lGJVs on line 11 ABCD
Output for 4.3.0 - 4.3.2
Notice: Uninitialized string offset: 4 in /in/lGJVs on line 7 (ABCD:4) (ABCD:4) (ABCD:4) (ABCD:4) ABCD