Get the MongoID back after an insert using PHP

Get the MongoID back after an insert using PHP

I am using PHP and the official Mongo driver and doing an insert.
$collection->insert($data_object);
Then doing:
$data_object_id = $data_object['_id'];
Which if I do:
print_r($data_object_id);
Looks right:
MongoId Object
(
[$id] => 521d982298a618b9798b456b
)
However, when trying to do:
echo "Inserted: " . $data_object_id->__toString() . "...";
I am getting the following error:
Catchable fatal error: Object of class stdClass could not be converted to
string