nice approach! Would it make sense to use a new array and merge with $array after the hook being emitted?
Otherwise the array could be manipulated