I occasionally come across pages where some Javascript is included via a PHP file:
Advantage (not PHP specific - I used this technique in EmbPerl and JSP) would be the ability to dynamically generate or tweak/customize the JavaScript code on the server side.
An example usage would be population of an array based on the contents of a DB table. Or application of localization techniques.