3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo extends stdClass {} $x = array('x' => 10); var_dump($x); var_dump((object)$x); var_dump(new stdClass('foo')); var_dump(new stdClass($x));
Output for 5.0.0 - 7.1.0
array(1) { ["x"]=> int(10) } object(stdClass)#1 (1) { ["x"]=> int(10) } object(stdClass)#1 (0) { } object(stdClass)#1 (0) { }
Output for 4.3.0 - 4.4.9
array(1) { ["x"]=> int(10) } object(stdClass)(1) { ["x"]=> int(10) } object(stdClass)(0) { } object(stdClass)(0) { }