3v4l.org

run code in 200+ 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 - 7.2.0
key1 => val1 key2 => val2 key3 => val3 key4 => val4 key5 => val5