1--TEST-- 2Bug #81294 (Segfault when removing a filter) 3--SKIPIF-- 4<?php 5if (!extension_loaded('zlib')) die("skip zlib extension not available"); 6?> 7--FILE-- 8<?php 9$f = fopen(__DIR__ . "/bug81294.txt", "wb+"); 10$flt1 = stream_filter_append($f, "zlib.deflate", STREAM_FILTER_WRITE); 11$flt2 = stream_filter_append($f, "string.rot13", STREAM_FILTER_WRITE); 12fwrite($f, "test"); 13stream_filter_remove($flt1); 14fwrite($f, "test"); 15stream_filter_remove($flt2); 16rewind($f); 17var_dump(urlencode(fread($f, 1024))); 18?> 19--CLEAN-- 20<?php 21@unlink(__DIR__ . "/bug81294.txt"); 22?> 23--EXPECT-- 24string(16) "%2BV-.%01%00grfg" 25