PHP is an interpreted language not a compiled language, so your code never does get compiled like it does in .NET. There are tools that allow you to obfuscate your code to make it hard for it to be deciphered, but even the best PHP programmers can get around those.
Also, most of .NET components can be decompiled using tools such as ilSpy and Reflector, so even those are not 100% safe once compiled.
Search for "php encoder" - they can convert php to bytecode and encrypt so getting to the source is very difficult. However most (or maybe all) of them are commercial and require installation on the server.