2

In C++, each class has a .h file and a .cpp file, is that possible in PHP?

The reason i want this for, is that when i give my class file to another person to use it I dont want him to view my source code,

I just want him to use the class without viewing the source.

4
  • 1
    You perhaps need to obfuscate your code.. It will make code non-human-readable. It is impossible to allow someone to have your class without viewing it's source code. Commented Dec 20, 2012 at 11:44
  • Does "use" mean actual production or just an interface to write code against? In the latter case you could just provide API documentation or use an interface Commented Dec 20, 2012 at 11:48
  • uses means to create an object of the class and call its functions Commented Dec 20, 2012 at 12:24
  • And why is that person not allowed to see the code? Commented Dec 20, 2012 at 12:44

1 Answer 1

5

No, PHP doesn't have an equivalent of header files. You may want something like http://www.ioncube.com or http://www.zend.com/en/products/guard/.

Really ask yourself why you're doing this before going down this route though.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.