We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c15cacc commit 3b387efCopy full SHA for 3b387ef
ext/standard/user_filters.c
@@ -476,16 +476,19 @@ PHP_FUNCTION(stream_get_filters)
476
477
ZEND_PARSE_PARAMETERS_NONE();
478
479
- array_init(return_value);
480
481
filters_hash = php_get_stream_filters_hash();
482
483
if (filters_hash && !HT_IS_PACKED(filters_hash)) {
+ array_init(return_value);
484
+ zend_hash_real_init_packed(Z_ARRVAL_P(return_value));
485
ZEND_HASH_MAP_FOREACH_STR_KEY(filters_hash, filter_name) {
486
if (filter_name) {
487
add_next_index_str(return_value, zend_string_copy(filter_name));
488
}
489
} ZEND_HASH_FOREACH_END();
490
+ } else {
491
+ RETURN_EMPTY_ARRAY();
492
493
/* It's okay to return an empty array if no filters are registered */
494
0 commit comments