I do understand why it does not work (it tries to enter into a non-declared element). I just asking what would be the best way to solve it. I can always add non-existing data to $files_href when I declare it but it does not feel right.
Anyway, thank you.