/** * Simple.h * * A very simple extension that does almost nothing * * @author Emiel Bruijntjes * @copyright 2013 Copernica BV */ #include #include #include /** * Namespace to use */ using namespace std; Php::Value bubblesort(Php::Parameters ¶ms) { cout << "start bubblesort" << endl; // the array that was passed Php::Value array(params[0]); cout << "go return" << endl; return array; // size of the array int size = array.size(); cout << "convert to native" << endl; int *x = new int[size]; for (int i=0; i x(&MyCustomClass::myMethod); // define classes extension.add("my_class", Php::Class({ Php::Public("a", 123), Php::Protected("b", "abc"), Php::Protected("myMethod", Php::Method(&MyCustomClass::myMethod)), Php::Public("__construct", Php::Method(&MyCustomClass::__construct)) })); // return the module entry return extension.module(); } }