PHP isn't executed by your Web browser. It's executed on the server to modify
what is sent to you.
Also, for JavaScript (and any other software, for that matter), it's not a
matter of whether it's "hidden". If a JavaScript program does not include
source code, or if it is not under a libre license, then it is proprietary.
Most JavaScript code is "minimized", and that's not source code. But even
disregarding that, most JavaScript code doesn't carry a libre license.
The way JavaScript on Web pages is handled by Web browsers also makes it
technically impossible to exercise freedom with such JavaScript code. For
this reason, I highly recommend disabling all JavaScript execution on your
Web browser, even if it's libre:
https://onpon4.github.io/other/kill-js/