1--TEST--
2Bug #79468	SIGSEGV when closing stream handle with a stream filter appended
3--SKIPIF--
4<?php
5$filters = stream_get_filters();
6if(! in_array( "string.rot13", $filters )) die( "skip rot13 filter not available." );
7?>
8--FILE--
9<?php
10$fp = fopen('php://temp', 'rb');
11$rot13_filter = stream_filter_append($fp, "string.rot13", STREAM_FILTER_WRITE);
12fwrite($fp, "This is ");
13fclose($fp);
14try {
15    stream_filter_remove($rot13_filter);
16} catch (\Throwable $e) {
17    var_dump($e->getMessage());
18}
19?>
20--EXPECTF--
21Warning: stream_filter_remove(): Invalid resource given, not a stream filter in %s on line %d
22