while current perfect square is less than or equal to n
while ( $ current <= $ n ) { array_push ( $ perfectSquares , $ current ) ; $ current = ( int ) pow ( ++ $ i , 2 ) ; } return $ perfectSquares ; }