replace yield keyword by iterator to work with php5.4