That's because of system entries .
and ..
which are pointers to 'current directory' and 'parent directory'. You'll need to filter them if you don't want to see them in your output.
You may want to filter your entries with is_file() - then .
and ..
would be skipped since they are actually directories (pointers to them)