1--TEST-- 2Bug #52944 (segfault with zlib filter and corrupted data) 3--SKIPIF-- 4<?php if (!extension_loaded("zlib")) print "skip"; ?> 5<?php 6if (PHP_OS != 'Darwin') { 7 die("skip Darwin only"); 8} 9--INI-- 10allow_url_fopen=1 11--FILE-- 12<?php 13require dirname(__FILE__) . "/bug_52944_corrupted_data.inc"; 14 15$fp = fopen('data://text/plain;base64,' . $data, 'r'); 16stream_filter_append($fp, 'zlib.inflate', STREAM_FILTER_READ); 17var_dump(fread($fp,1)); 18var_dump(fread($fp,1)); 19fclose($fp); 20echo "Done.\n"; 21--EXPECT-- 22string(1) "%" 23string(1) "C" 24Done. 25