diff options
Diffstat (limited to 'src/object.cpp')
-rw-r--r-- | src/object.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/object.cpp b/src/object.cpp index f1bcdf8..a0777fe 100644 --- a/src/object.cpp +++ b/src/object.cpp @@ -27,10 +27,13 @@ Object::Object(const char *name, Base *base) } else { + // we need the tsrm_ls variable + TSRMLS_FETCH(); + // this is a brand new object that should be allocated, the C++ instance // is already there (created by the extension) but it is not yet stored // in PHP, find out the classname first - auto *entry = zend_fetch_class(name, strlen(name), 0); + auto *entry = zend_fetch_class(name, strlen(name), 0 TSRMLS_CC); if (!entry) throw Php::Exception(std::string("Unknown class name ") + name); // store the object in the php object cache (this will give the object a handle) @@ -47,8 +50,11 @@ Object::Object(const char *name, Base *base) */ void Object::instantiate(const char *name) { + // we need the tsrm_ls variable + TSRMLS_FETCH(); + // convert the name into a class_entry - auto *entry = zend_fetch_class(name, strlen(name), 0); + auto *entry = zend_fetch_class(name, strlen(name), 0 TSRMLS_CC); if (!entry) throw Php::Exception(std::string("Unknown class name ") + name); // initiate the zval (which was already allocated in the base constructor) |