This can be simplified with `strrchr($basename, '.')`