<?php

require 'filter_errors.inc';
filter_errors_test('zlib.inflate', gzencode('42'));
<?php

require 'filter_errors.inc';
filter_errors_test('convert.base64-decode', '===');
Example #3
0
    }
}
class test_filter4 extends php_user_filter
{
    function filter($in, $out, &$consumed, $closing)
    {
        if (!$closing) {
            $bucket = stream_bucket_new($this->stream, "42");
        }
        return PSFS_ERR_FATAL;
    }
}
for ($i = 0; $i < 5; ++$i) {
    echo "test_filter{$i}\n";
    var_dump(stream_filter_register("test_filter{$i}", "test_filter{$i}"));
    filter_errors_test("test_filter{$i}", "42");
}
echo "test append / read / remove\n";
for ($i = 0; $i < 5; ++$i) {
    echo "test_filter{$i}\n";
    $stream = fopen('php://memory', 'wb+');
    fwrite($stream, "42");
    fseek($stream, 0, SEEK_SET);
    $f = stream_filter_append($stream, "test_filter{$i}");
    stream_get_contents($stream);
    stream_filter_remove($f);
}
echo "test append all / read / remove all\n";
$stream = fopen('php://memory', 'wb+');
fwrite($stream, "42");
fseek($stream, 0, SEEK_SET);