API - Basic API calls

I thought of doing it JavaScript style. But I thought of one little hindrance. Is there some equivalent of $.extend in PHP? (something like $.extend({}, defaults, options);)