<?php$obj = (object) array();$obj->foo = 10;var_dump($obj); $o = new stdClass();$o->foo = 'bar';var_dump($o);
Standard input is empty
object(stdClass)#1 (1) { ["foo"]=> int(10) } object(stdClass)#2 (1) { ["foo"]=> string(3) "bar" }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!