例如,Dataset
对象的此方法返回NULL
,如何使其返回$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();
}
尝试
zval *object = getThis();
RETURN_ZVAL(object,false,false);
给我一个错误
只是为了确定这个
RETURN_ZVAL(getThis(),false,false);
结果相同
RETURN_ZVAL(getThis(),1,0);
是正确的答案,但不确定为什么
来自http://www.snailinaturtleneck.com/blog/2011/08/11/php-extensions-made-eldrich-classes/#comment-466980122