Help creating PHP classes using public/private from C++
Posted: Mon Dec 14, 2009 4:09 pm
Hi, I have to port a C++ program to PHP in order to use it on a Web server and I don't understand how to go about it. I have absolutely zero experience with PHP. I'm going to go about this very incrementally. So, my first step is to convert the classes into PHP.
How do I implement
class semUnit
{
public:
D2bar* getAgent();
D2bar* getTheme();
semUnit();
semUnit(D2bar* a, D2bar* b);
string printAgent();
string printTheme();
private:
D2bar* Agent;
D2bar* Theme;
};
in PHP?
I've heard that PHP5 offers the ability to distinguish between private and public so I'd like to use this feature.
How do I implement
class semUnit
{
public:
D2bar* getAgent();
D2bar* getTheme();
semUnit();
semUnit(D2bar* a, D2bar* b);
string printAgent();
string printTheme();
private:
D2bar* Agent;
D2bar* Theme;
};
in PHP?
I've heard that PHP5 offers the ability to distinguish between private and public so I'd like to use this feature.