Add property to standard object

I, very hackily, create an object of type stdClass as so:

$arr = array(
    'foo' => 'bar',
    'baz' => 'bat'
);

$obj = json_decode(json_encode($arr));

How can I now quickly add a third property to $obj without PHP getting angry?