How to return $ this in php extension?
For example this method of an object Dataset
returns NULL
how to make it return$this
PHP_METHOD(TSet, nextLine)
{
TSet *MySet;
tset_object *obj = (tset_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
MySet = obj->DataSet;
if (MySet != NULL) {
MySet->nextLine();
}
RETURN_NULL();
}
Tried
zval *object = getThis();
RETURN_ZVAL(object,false,false);
Give me a segfault
And just to make sure it's
RETURN_ZVAL(getThis(),false,false);
With the same result
+3
source to share
1 answer
RETURN_ZVAL (getThis (), 1, 0);
Correct answer, I don't know why. Got it from http://www.snailinaturtleneck.com/blog/2011/08/11/php-extensions-made-eldrich-classes/#comment-466980122
+2
source to share