diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-03 18:03:39 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-03 18:03:39 +0100 |
commit | 70986b4bcdf7793c4bb8a4e14d91e6531c95f651 (patch) | |
tree | 3009209b9fbcb3d51bc117061a766341c8a71a24 /Examples/CppClassesInPhp/cppclassinphp.php | |
parent | 8f24af4c28e74ef1769aef6ab00c480e09be7453 (diff) |
work in progress for support for creating object instances
Diffstat (limited to 'Examples/CppClassesInPhp/cppclassinphp.php')
-rw-r--r-- | Examples/CppClassesInPhp/cppclassinphp.php | 23 |
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"); |