3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = "abcd"; $len = strlen($str); $pos = floor($len/2); for($i = $len; $i > $pos; $i--) { echo ord($str[$pos+$i]).">>>".ord($str[$pos-$i])."\n"; }
based on 4mWij
Output for 7.1.0 - 7.3.1
Notice: String offset cast occurred in /in/jp00o on line 7 Notice: Uninitialized string offset: 6 in /in/jp00o on line 7 Notice: String offset cast occurred in /in/jp00o on line 7 0>>>99 Notice: String offset cast occurred in /in/jp00o on line 7 Notice: Uninitialized string offset: 5 in /in/jp00o on line 7 Notice: String offset cast occurred in /in/jp00o on line 7 0>>>100
Output for 5.4.5 - 7.0.20
Notice: String offset cast occurred in /in/jp00o on line 7 Notice: Uninitialized string offset: 6 in /in/jp00o on line 7 Notice: String offset cast occurred in /in/jp00o on line 7 Notice: Uninitialized string offset: -2 in /in/jp00o on line 7 0>>>0 Notice: String offset cast occurred in /in/jp00o on line 7 Notice: Uninitialized string offset: 5 in /in/jp00o on line 7 Notice: String offset cast occurred in /in/jp00o on line 7 Notice: Uninitialized string offset: -1 in /in/jp00o on line 7 0>>>0
Output for 5.4.0 - 5.4.4
Notice: String offset cast occured in /in/jp00o on line 7 Notice: Uninitialized string offset: 6 in /in/jp00o on line 7 Notice: String offset cast occured in /in/jp00o on line 7 Notice: Uninitialized string offset: -2 in /in/jp00o on line 7 0>>>0 Notice: String offset cast occured in /in/jp00o on line 7 Notice: Uninitialized string offset: 5 in /in/jp00o on line 7 Notice: String offset cast occured in /in/jp00o on line 7 Notice: Uninitialized string offset: -1 in /in/jp00o on line 7 0>>>0
Output for 5.2.10 - 5.3.29
Notice: Uninitialized string offset: 6 in /in/jp00o on line 7 Notice: Uninitialized string offset: -2 in /in/jp00o on line 7 0>>>0 Notice: Uninitialized string offset: 5 in /in/jp00o on line 7 Notice: Uninitialized string offset: -1 in /in/jp00o on line 7 0>>>0
Output for 4.3.0 - 5.2.9
Notice: Uninitialized string offset: 6 in /in/jp00o on line 7 Notice: Uninitialized string offset: -2 in /in/jp00o on line 7 0>>>0 Notice: Uninitialized string offset: 5 in /in/jp00o on line 7 Notice: Uninitialized string offset: -1 in /in/jp00o on line 7 0>>>0