在PHP中将代码拆分为标题/源文件

在PHP中将代码拆分为标题/源文件

问题描述:

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.

在C ++中,每个类都有一个 .h code>文件和一个 .cpp code>文件,在PHP中是可能的吗? p>

我想要这个的原因是,当我将我的类文件交给另一个人使用它时,我不希望他查看 我的源代码, p>

我只是希望他在不查看源代码的情况下使用该类。 p> div>

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.