php 5.4 compat - unset reference after foreach