This is a quote from another answer on superuser.com: (https://superuser.com/questions/612178/how-to-set-php-syntax-for-a-file-without-php-tag?utm_source=chatgpt.com)
Put #<?php at the top of the file. PHP will treat it as a comment. Sublime won't. Perfect.
if helpful for anybody I also want to point out that this trick works for vscode. I am using this bc I have some software where i have to input pure php without open tag and i also save the whole code in a php file which requires the open php tag. With this comment trick i can still get syntax highlighting and also copy the whole file in the software where it will treat the first line as a comment.