Category Archives: Uncategorized

array_replace_recursive() Alternative


I was using array_replace_recursive() to merge default option values and user-defined parameter values. However, it is supported in PHP 5.3 or above. Then some of my users reported that my plugin does not work with a fatal error.

So I wrote up an alternative for it. One limitation though is that it only accepts two parameters unlike the PHP’s array_replace_recursive() which supports more than two.

Anyhow this is the code and hope it helps somebody else who gets a similar issue.