Skip to content

Commit d726002

Browse files
committed
Print objects with null hash table like others in print_r
Noticed when working on subsequent commits for SplFixedArray. Make whether zend_get_properties_for returns null or an empty array invisible to the end user - it would be always be a non-null array for user-defined classes. Noticed when working on SplFixedArray changes, e.g. in ext/spl/tests/SplFixedArray__construct_param_null.phpt
1 parent b449712 commit d726002

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

Zend/tests/function_arguments/sensitive_parameter_value.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ object(SensitiveParameterValue)#%d (0) {
3131
object(SensitiveParameterValue)#%d (%d) refcount(%d){
3232
}
3333
SensitiveParameterValue Object
34+
(
35+
)
3436

3537
# var_export()
3638
\SensitiveParameterValue::__set_state(array(

Zend/zend.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /*
507507
}
508508

509509
if ((properties = zend_get_properties_for(expr, ZEND_PROP_PURPOSE_DEBUG)) == NULL) {
510+
print_hash(buf, (HashTable*) &zend_empty_array, indent, 1);
510511
break;
511512
}
512513

ext/spl/tests/ArrayObject_overloaded_SplFixedArray.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ object(ArrayObject)#1 (1) {
2525
object(stdClass)#4 (0) {
2626
}
2727
}
28-
}
28+
}

0 commit comments

Comments
 (0)