diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-02 23:28:10 +0100 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-03-02 23:28:10 +0100 |
commit | 8f24af4c28e74ef1769aef6ab00c480e09be7453 (patch) | |
tree | c73b7de11abbdd8ed2d3f3fa5b63fdd2a1409cb8 /Examples | |
parent | f7dcf5d81fa1e43533c786d9443e5222398dc8b9 (diff) |
work in progress to support implementing SPL interfaces, disabled the _self variable in Php::Base because by having each object keeping a reference to itself, the refcounter never reached zero and the object was thus never destructed, checking if we can get a new implementation one way or another
Diffstat (limited to 'Examples')
-rw-r--r-- | Examples/CppClassesInPhp/cppclassinphp.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/Examples/CppClassesInPhp/cppclassinphp.cpp b/Examples/CppClassesInPhp/cppclassinphp.cpp index 70233c9..7ef4d12 100644 --- a/Examples/CppClassesInPhp/cppclassinphp.cpp +++ b/Examples/CppClassesInPhp/cppclassinphp.cpp @@ -11,7 +11,7 @@ */ using namespace std; -class MyCustomClass : public Php::Base +class MyCustomClass : public Php::Base // , public Php::Countable { private: int _x; @@ -39,6 +39,11 @@ public: std::cout << "MyCustomClass::__destruct" << std::endl; } + virtual Php::Value count() //override + { + return 33; + } + void myMethod(Php::Parameters ¶ms) { // check number of parameters @@ -47,12 +52,12 @@ public: std::cout << "myMethod is called." << std::endl; _x = params[0]; - std::cout << "get property1 " << value()["property1"] << std::endl; - - // set it to something else - value().set("property1", "new value"); - - std::cout << "get property1 " << value()["property1"] << std::endl; + // std::cout << "get property1 " << value()["property1"] << std::endl; + // + // // set it to something else + // value().set("property1", "new value"); + // + // std::cout << "get property1 " << value()["property1"] << std::endl; } }; |