3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = ''; var_dump($str[0]); var_dump(current($str));
Output for 5.3.3 - 5.6.28, 7.0.0 - 7.1.0
Notice: Uninitialized string offset: 0 in /in/PsFFh on line 3 string(0) "" Warning: current() expects parameter 1 to be array, string given in /in/PsFFh on line 4 NULL
Output for hhvm-3.10.0 - 3.12.0
string(0) "" Warning: Invalid operand type was used: expecting an array in /in/PsFFh on line 4 bool(false)
Output for 5.2.14 - 5.2.17
Notice: Uninitialized string offset: 0 in /in/PsFFh on line 3 string(0) "" Warning: current(): Passed variable is not an array or object in /in/PsFFh on line 4 bool(false)