Skip to content

Commit 9a347ee

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 749b52c commit 9a347ee

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
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

0 commit comments

Comments
 (0)