The UBB.threads CSS files are generated through a trigger when you update a style from the Control Panel; these files always end in .css. PHP files in the /styles folder should only be wrappers.php which holds your installed style HTML wrappers and a numerated file (such as 1.php) which contain the information about each style.
You should not have any .php files other than these, you might want to look through backups or see if there is a period in front of the file in your logs (if a filename is prefixed by a period it'll be hidden from FTP clients unless they're specifically set to display hidden files), you'll want to open this file to ensure its even a forum file or if someone is hiding PHP script content masquerading it as a legit file.
FWIW, the UBB.threads v7.7.5 upgrade utility should have no problem working on PHP7 and supports MySQL8.