summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index d2f5e00e91..74b7cbfb27 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -861,7 +861,7 @@ static void _function_string(string *str, zend_function *fptr, zend_class_entry
string_printf(str, "\n");
string_printf(str, "%s - Static Parameters [%d] {\n", indent, count);
if (closure_this) {
- string_printf(str, "%s Parameter #%d [ %s $this ]\n", indent, ++index, Z_OBJCE_P(closure_this)->name);
+ string_printf(str, "%s Parameter #%d [ %s $this ]\n", indent, index++, Z_OBJCE_P(closure_this)->name);
}
if (static_variables) {
HashPosition pos;
@@ -869,7 +869,7 @@ static void _function_string(string *str, zend_function *fptr, zend_class_entry
char* key;
ulong num_index;
zend_hash_internal_pointer_reset_ex(static_variables, &pos);
- while (index++ < count) {
+ while (index < count) {
zend_hash_get_current_key_ex(static_variables, &key, &key_len, &num_index, 0, &pos);
string_printf(str, "%s Parameter #%d [ $%s ]\n", indent, index++, key);
zend_hash_move_forward_ex(static_variables, &pos);
@@ -1570,7 +1570,9 @@ ZEND_METHOD(reflection_function, getClosureThis)
GET_REFLECTION_OBJECT_PTR(fptr);
if (intern->obj) {
closure_this = zend_get_closure_this_ptr(intern->obj TSRMLS_CC);
- RETURN_ZVAL(closure_this, 1, 0);
+ if (closure_this) {
+ RETURN_ZVAL(closure_this, 1, 0);
+ }
}
}
/* }}} */