This is that function.. converting a zval to bson for write options.. and the other one you commented on was the reverse..
I don't think it makes sense to chunk them into multiple functions.. php_mongo_api_add_w, api_add_wtimeout, api_add_j, api_add_fsync... that is useless imo