1//You can use stdClass which is sort of empty template
2$object = new stdClass();
3
4//Assign property
5$object->property = 'Here we go';
6
7//Now if we dump it
8 var_dump($object);
9 /*
10 outputs:
11 object(stdClass)#2 (1) {
12 ["property"]=>
13 string(10) "Here we go"
14 }
15 */
16//Even shorter
17$object = (object) ['property' => 'Here we go'];