From b4c45b7be83904b6a7d4dcb4f5aef991bda29fc9 Mon Sep 17 00:00:00 2001 From: Anthon Pang Date: Tue, 21 Nov 2023 20:47:15 +0000 Subject: [PATCH] fixes Globals example where `Php::GLOBALS["c"]["member"]` is not set --- include/global.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/global.h b/include/global.h index 605aeec0..025242c0 100644 --- a/include/global.h +++ b/include/global.h @@ -97,6 +97,7 @@ class PHPCPP_EXPORT Global : public Value Global &operator=(const T &value) { Value::operator=(value); + return update(); } @@ -109,11 +110,12 @@ class PHPCPP_EXPORT Global : public Value */ virtual void set(int index, const Value &value) override { - // update current object - update(); - // call base Value::set(index, value); + + // update current object + _exists = false; + update(); } /** @@ -126,11 +128,12 @@ class PHPCPP_EXPORT Global : public Value */ virtual void set(const char *key, int size, const Value &value) override { - // update current object - update(); - // call base Value::set(key, size, value); + + // update current object + _exists = false; + update(); }