bson: allow encoding of arrays.
php: add some examples