summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/bug39551.phpt
blob: c047a306ece63667f71d8da35e65b15471dc505f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Bug #39551 (Segfault with stream_bucket_new in user filter)
--FILE--
<?php

$bucket = stream_bucket_new(fopen('php://temp', 'w+'), '');

class bucketFilter {
	public function filter($in, $out, &$consumed, $closing ){

		$bucket = stream_bucket_new(fopen('php://temp', 'w+'), '');
		stream_bucket_append($out, $bucket);
		return PSFS_PASS_ON;
	}
}

stream_filter_register('bucketfault', 'bucketFilter');
stream_filter_append($s = fopen('php://temp', 'r+'), 'bucketfault');
stream_get_contents($s);

echo "Done\n";
?>
--EXPECTF--	
Done