Of course it does.
PhP is a server-side language. this means the code is executed, BEFORE the page is oaded in the webbrowser. Javascript runs on the CLIENTS computer.
So.. No you cannot combine them in this way.
You could of course have javascript load a new page and/or refresh your page to perform some PhP action in an other page.
But I would not rely on this.
J.