summaryrefslogtreecommitdiff
path: root/src/parameters.cpp
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-12 15:45:19 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-12 15:45:19 +0100
commit21edee4d584dbf757b006349e903ff7a3b398a1d (patch)
tree2532ec92649726a2ff59ba440c4090e80c679d9d /src/parameters.cpp
parent4415b472ae57e367e1fcece4c04355b55a868a1b (diff)
support for static methods
Diffstat (limited to 'src/parameters.cpp')
-rw-r--r--src/parameters.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parameters.cpp b/src/parameters.cpp
index 2fb2eef..b923bd5 100644
--- a/src/parameters.cpp
+++ b/src/parameters.cpp
@@ -39,6 +39,11 @@ Parameters::Parameters(zval *this_ptr, int argc TSRMLS_DC) : _this(this_ptr)
*/
Base *Parameters::object()
{
+ // do we have a this pointer in the first place? The member is not set
+ // when static methods are being called, or when a regular function is
+ // called in a static context
+ if (!_this) return nullptr;
+
// get the mixed object
MixedObject *obj = (MixedObject *)zend_object_store_get_object(_this TSRMLS_CC);