JSON encode, and then decode your object passing true as the second param in the decode function. This will return an associative array.
$array = json_decode(json_encode($object), true);
Now you can use your new array
echo $array['content']['5'];
Using $object->content->{'5'}
will not work if the object was created by casting an array to an object.
A more detailed description can be found here: https://stackoverflow.com/a/10333200/58795