3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $string = 'some thing here'; foreach ($string as $char) { var_dump($char); } for ($i = 0; $i < strlen($string); $i++) { var_dump($string[$i]); }
based on vJYD8
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: Invalid argument supplied for foreach() in /in/XrYSX on line 5 string(1) "s" string(1) "o" string(1) "m" string(1) "e" string(1) " " string(1) "t" string(1) "h" string(1) "i" string(1) "n" string(1) "g" string(1) " " string(1) "h" string(1) "e" string(1) "r" string(1) "e"
Output for hhvm-3.12.0
Warning: Invalid argument supplied for foreach() in /in/XrYSX on line 7 string(1) "s" string(1) "o" string(1) "m" string(1) "e" string(1) " " string(1) "t" string(1) "h" string(1) "i" string(1) "n" string(1) "g" string(1) " " string(1) "h" string(1) "e" string(1) "r" string(1) "e"
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.3.11
string(1) "s" string(1) "o" string(1) "m" string(1) "e" string(1) " " string(1) "t" string(1) "h" string(1) "i" string(1) "n" string(1) "g" string(1) " " string(1) "h" string(1) "e" string(1) "r" string(1) "e"