C++ classes in PHP4 extensions
| From: | Klaus Reimer | Date: | Wed, 22 Mar 2000 09:48:36 +0000 |
| Subject: | C++ classes in PHP4 extensions | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-12485@lists.php.net to get a copy of this message | ||
Hi,
Another question concerning PHP4 extensions written in C++:
Is it possible to access methods in a C++ class from PHP4? Lets say I have
written a class like this in C++:
class CTest {
public:
int getNumber(void);
};
int CTest::getNumber(void) {
return 42;
};
And now I want to access this class in PHP like this:
<?php
$Test=new CTest;
printf("%d<br>\n",$Test->getNumber());
?>
Is this possible? And if it is possible: How must the source of the C++ class
look like? How to make the class accessible to PHP?
Bye
K