There are PHP obfuscators that can turn your PHP code into something unreadable. But if someone is determined, they could probably find a way to de-obfuscate it.
As far as what you are talking about creating a DLL file, DLL files are specific to the Windows operating system. Such a thing would not work on a Linux system. But yes, you could do something similar by creating your own PHP extensions which would contain your code in binary form (or at least intermediate code) which you would call in your PHP scripts using function calls. I am not much familiar with how the Linux operating system works, with Windows you can create a DLL and it can be used by all kinds of different programs. I don't think a PHP extension would be widely available to anything other than PHP on a Linux box. Also, most users on shared servers cannot install their own custom PHP extensions. So your audience for hiding your code in a PHP extension would be limited, assuming you are hiding your code because people will be using it but not looking at it.