similarly to basename, this method also suffers corruption if filename starts with non-ascii and locale not set to matching charset
$ LC_ALL=C php -r 'var_dump(basename("?mb.er")); $fi = new SplFileInfo("?m.ber"); var_dump($fi->getBasename());';
string(5) "mb.er"
string(5) "m.ber"
$ LC_ALL=en_US.UTF-8 php -r 'var_dump(basename("?mb.er")); $fi = new SplFileInfo("?m.ber"); var_dump($fi->getBasename());';
string(7) "?mb.er"
string(7) "?m.ber"