3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = '12345'; $c = ''; for($i = 0; $a{$i} != ''; $i++) { echo 1; $c = $a{$i} . $c; } var_dump($c);
based on kjrW9
Output for 5.2.10 - 5.6.28, 7.0.0 - 7.1.0
11111 Notice: Uninitialized string offset: 5 in /in/VAK7q on line 4 string(5) "54321"
Output for hhvm-3.10.0 - 3.12.0
11111string(5) "54321"
Output for 4.3.0 - 5.2.9
11111 Notice: Uninitialized string offset: 5 in /in/VAK7q on line 4 string(5) "54321"