Can I use a style.php?
Yes you can but you shouldn't. 

When adding a stylesheet, Drupal does not tamper the file names. So regardless of the way you add it, your PHP file or whatever file name you use will be added to the import clauses or to the link tag. 

However, note that Drupal can combine those CSS files, and it uses file_get_contents() function to get the file contents. In that case, Drupal will get the source code of your PHP file, making this approach fail. 

If you want to add dynamic CSS, you can go for some workarounds though. 


Add all possible styles to one stylesheet under different classes, and only change the class name of the HTML that you want to change styles of. 
Have a predefined set of stylesheets, and only add the ad-hoc in a preprocess function or something. 
Add the styles as inline CSS. 


Other than that, the core Color module has some similar approaches that you might find useful.