@ojsimon
Like the guys have already said, No matter what part of your code you can hide, it always has an input output like a function. Someone could easily figure out what those are and ignore it.
To make it hard, not impossible, is to encode and obfuscate your PHP code to make it very difficult to take the time and see your source code.
PHP is based on the spirit of open source and community. Unless your charging, just put your credit line as the author and most people will respect it. Once you have distributed something, it gets its own timestamps on the Internet. Six months later someone just can't come out and say I developed this, there will be people out there that will say no, this guy did six month ago.
Don't be afraid to have your code change to a better one either.
If you're looking to make money by selling PHP code, I suggest you code using a compiled language. (Even those aren't 100% safe).
Sorry for the prolix reply,
Good luck,
Dan