Fixed iterator building for php < 5.5