array_replace throwing php_warning but working anyway

$term_object->order tells you $term_object is an object. array_replace() expects an array, not an object.

Not sure why it works, maybe PHP is casting the object to an array.

array_replace( $term_objects, (array) $term_object );

… could fix the warning.