3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = "My Name is Fred"; $i = 0; while( $d = $str[$i] ) { if( $d == " "){ $out = " ".$temp.$out; $temp = ""; }else{ $temp.=$d; } $i++; } echo $temp.$out; ?>
Output for 5.2.10 - 5.6.28, 7.0.0 - 7.1.0
Notice: Undefined variable: temp in /in/9dUqi on line 12 Notice: Undefined variable: out in /in/9dUqi on line 9 Notice: Uninitialized string offset: 15 in /in/9dUqi on line 5 Fred is Name My
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: out in /in/9dUqi on line 9 Fred is Name My
Output for 5.0.4 - 5.2.9
Notice: Undefined variable: temp in /in/9dUqi on line 12 Notice: Undefined variable: out in /in/9dUqi on line 9 Notice: Uninitialized string offset: 15 in /in/9dUqi on line 5 Fred is Name My
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: temp in /in/9dUqi on line 12 Notice: Undefined variable: out in /in/9dUqi on line 9 Notice: Uninitialized string offset: 15 in /in/9dUqi on line 5 Fred is Name My