erase $where[$k] in a clean way before setting it

There is no guarantee that keys will always be numeric keys beginning with 0 and 1 so that the former values in $where[$k] would be erased.