This still sounds like a situation whereby you would be better off manually creating a default object:
$default = (object)['username' => null, 'firstname' => null, 'lastname' => null, ... ];
Rather than relying on tricks to automatically create the object. But, at least I now understand your use-case for what you wanted to do.