Adjust PHP sync example

Make it work with how globals are actually wrapped.  It looks like
this example has never been right, but nobody noticed before PHP 8
started warning about the use of unset variables.

This reveals that handling of std::string properties needs fixing.
This commit is contained in:
Olly Betts 2021-04-18 09:56:55 +12:00
commit a49cc60772
3 changed files with 48 additions and 16 deletions

View file

@ -1,9 +1,14 @@
extern char *s;
#include <string>
extern std::string s;
extern int x;
class Sync {
public:
int x;
char *s;
void printer(void);
std::string s;
void printer();
void all_change();
Sync() : x(0) { }
};