]> granicus.if.org Git - php/commitdiff
- Return this pointer and not closure itself
authorMarcus Boerger <helly@php.net>
Sat, 3 Jan 2009 19:08:27 +0000 (19:08 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 3 Jan 2009 19:08:27 +0000 (19:08 +0000)
ext/reflection/php_reflection.c

index 9d5c0f4cd6be0d27d6f80c4eeec7672263fa463d..76ec34cc56abb23cfc5cf346a45e84e1fa668726 100644 (file)
@@ -1591,10 +1591,14 @@ ZEND_METHOD(reflection_function, getClosureThis)
 {
        reflection_object *intern;
        zend_function *fptr;
+       zval* closure_this;
 
        METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0);
        GET_REFLECTION_OBJECT_PTR(fptr);
-       RETURN_ZVAL(intern->obj, 1, 0);
+       if (intern->obj) {
+               closure_this = zend_get_closure_this_ptr(intern->obj TSRMLS_CC);
+               RETURN_ZVAL(closure_this, 1, 0);
+       }
 }
 /* }}} */