3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function getasfkingnumber($to_encode){ $i='a'; $ii=0; $replace=array(); for($i='a';$i<'z';++$i){ ++$ii; $replace[$i]=$ii; } $ii=0; $ret=''; for($ii=0;$ii<strlen($to_encode);++$ii){ $ret.=$to_encode[$to_encode[$ii]]; } return $ret; } var_dump(getasfkingnumber("thequickbrownfox"));
Output for 5.4.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: Illegal string offset 't' in /in/BWkes on line 14 Warning: Illegal string offset 'h' in /in/BWkes on line 14 Warning: Illegal string offset 'e' in /in/BWkes on line 14 Warning: Illegal string offset 'q' in /in/BWkes on line 14 Warning: Illegal string offset 'u' in /in/BWkes on line 14 Warning: Illegal string offset 'i' in /in/BWkes on line 14 Warning: Illegal string offset 'c' in /in/BWkes on line 14 Warning: Illegal string offset 'k' in /in/BWkes on line 14 Warning: Illegal string offset 'b' in /in/BWkes on line 14 Warning: Illegal string offset 'r' in /in/BWkes on line 14 Warning: Illegal string offset 'o' in /in/BWkes on line 14 Warning: Illegal string offset 'w' in /in/BWkes on line 14 Warning: Illegal string offset 'n' in /in/BWkes on line 14 Warning: Illegal string offset 'f' in /in/BWkes on line 14 Warning: Illegal string offset 'o' in /in/BWkes on line 14 Warning: Illegal string offset 'x' in /in/BWkes on line 14 string(16) "tttttttttttttttt"
Output for 4.3.0 - 5.3.29, hhvm-3.10.0 - 3.12.0
string(16) "tttttttttttttttt"