3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array("foo" => "Hello", "bar" => "World"); var_dump((Object) $arr); $obj = new stdClass(); $obj->foo = "Hello"; $obj->bar = "World"; var_dump((array) $obj);
Output for 5.0.0 - 7.1.0
object(stdClass)#1 (2) { ["foo"]=> string(5) "Hello" ["bar"]=> string(5) "World" } array(2) { ["foo"]=> string(5) "Hello" ["bar"]=> string(5) "World" }
Output for 4.3.0 - 4.4.9
object(stdClass)(2) { ["foo"]=> string(5) "Hello" ["bar"]=> string(5) "World" } array(2) { ["foo"]=> string(5) "Hello" ["bar"]=> string(5) "World" }