Annotation of embedaddon/php/ext/standard/tests/filters/bug46164-1.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #46164 - 1 (stream_filter_remove() closes the stream)
! 3: --FILE--
! 4: <?php
! 5: class user_filter extends php_user_filter {
! 6: function filter($in, $out, &$consumed, $closing) {
! 7: while($bucket = stream_bucket_make_writeable($in)) {
! 8: $consumed += $bucket->datalen;
! 9: stream_bucket_append($out, $bucket);
! 10: }
! 11: return PSFS_PASS_ON;
! 12: }
! 13: }
! 14: stream_filter_register('user_filter','user_filter');
! 15:
! 16: $fd = fopen('php://memory','w');
! 17: $filter = stream_filter_append($fd, 'user_filter');
! 18: stream_filter_remove($filter);
! 19: var_dump(fclose($fd));
! 20: ?>
! 21: --EXPECT--
! 22: bool(true)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>