swig/Examples/php/sync/example.cxx
Olly Betts 09d06843d1 Fix PHP sync example
Mostly it was missing `%include <std_string.i>`
2021-04-19 11:26:32 +12:00

19 lines
466 B
C++

#include "example.h"
#include <iostream>
int x = 42;
std::string s = "Test";
void Sync::printer() {
std::cout << "The value of global s is " << ::s << '\n';
std::cout << "The value of global x is " << ::x << '\n';
std::cout << "The value of class s is " << this->s << '\n';
std::cout << "The value of class x is " << this->x << '\n';
}
void Sync::all_change() {
::s = "global change";
++::x;
this->s = "local change";
++this->x;
}