summaryrefslogtreecommitdiff
path: root/Examples/CppClassesInPhp/cppclassinphp.php
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/CppClassesInPhp/cppclassinphp.php')
-rw-r--r--Examples/CppClassesInPhp/cppclassinphp.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/Examples/CppClassesInPhp/cppclassinphp.php b/Examples/CppClassesInPhp/cppclassinphp.php
index b535f0e..c969a4c 100644
--- a/Examples/CppClassesInPhp/cppclassinphp.php
+++ b/Examples/CppClassesInPhp/cppclassinphp.php
@@ -5,13 +5,32 @@
*
* 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
-$object->myMethod(1);
-$object->myMethod(2);
+$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");