3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $obj = new stdClass(); $obj->key1 = 'val1'; $obj->key2 = 'val2'; $obj->key3 = 'val3'; $obj->key4 = 'val4'; $obj->key5 = 'val5'; foreach ($obj as $key => $val) { echo $key.' => '.$val."\n"; }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
key1 => val1 key2 => val2 key3 => val3 key4 => val4 key5 => val5