If you don't want to do this:
$myObj = new stdClass();
$myObj->key_1 = 'Hello';
$myObj->key_2 = 'Dolly';
You can use one of the following:
PHP >=5.4
$myObj = (object) [
'key_1' => 'Hello',
'key_3' => 'Dolly',
];
PHP <5.4
$myObj = (object) array(
'key_1' => 'Hello',
'key_3' => 'Dolly',
);