blob: c969a4c6a0d6e6858d8d6859745a30604259706a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
<?php
/**
* cppclassinphp.php
* @author Jasper van Eck<jasper.vaneck@copernica.com>
*
* An example file to show the working of using a C++ class in PHP.
*/
class TestClass
{
public $x = 1223;
public function __construct()
{
echo("TestClass::__construct\n");
}
}
//create a MyCustomClass object, which is an object of a C++ class
$object = new MyClass();
// run a function of the class
$obj = $object->myMethod("MyClass");
echo(get_class($obj)."\n");
//echo($obj->format("Y-m-d")."\n");
//echo($obj->x."\n");
return;
//$object->myMethod(2);
echo($object->property1."\n");
echo($object->property2."\n");
|