3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = new stdClass(); $data->foo = bar; foreach ($data as $name => $value) { var_dump($name, $value); } var_dump((array)$data);
based on WJnaH
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Use of undefined constant bar - assumed 'bar' in /in/Rr430 on line 5 string(3) "foo" string(3) "bar" array(1) { ["foo"]=> string(3) "bar" }