import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-filters / stream_filter_remove_basic.php
blobff47a634dcb6698d8c0ed91bce2769746212893b
1 <?php
2 /* Prototype : bool stream_filter_remove(resource stream_filter)
3 * Description: Flushes any data in the filter's internal buffer, removes it from the chain, and frees the resource
4 * Source code: ext/standard/streamsfuncs.c
5 * Alias to functions:
6 */
8 echo "*** Testing stream_filter_remove() : basic functionality ***\n";
10 $file = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'streamfilterTest.txt';
11 touch( $file );
13 $fp = fopen( $file, 'w+' );
15 $filter = stream_filter_append( $fp, "string.rot13", STREAM_FILTER_WRITE );
16 fwrite( $fp, "Testing the rot13 filter which shifts some things around." );
18 var_dump( stream_filter_remove( $filter ) );
19 fwrite( $fp, "\nadd some more un-filtered foobar\n" );
21 rewind( $fp );
22 fpassthru( $fp );
23 fclose( $fp );
26 ===DONE===<?php
28 $file = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'streamfilterTest.txt';
29 unlink( $file );