When attempting to use php array functions such as array_keys/array_map with a FedoraObject instances's data streams, I couldn't find a way to do so. It seems as though all iteration must be done via for loops or using SPL Iterators class (Which are not always available).
It would be convenient to be able to get all the DSID's of an object by doing something like.
array_keys($object->datastreams); or array_keys($object);
or to utilize the array_map, and array_walk functions. http://www.php.net/manual/en/ref.array.php
We need discuss and think carefully before adding something like as $datastreams is currently protected and managed by the object, and I don't think it would be a good idea to expose it publicly.
Given the design we may not be able to have this functionality.