3v4l.org

run code in 200+ PHP versions simultaneously
<?php $fh = fopen('php://temp', 'w+'); fwrite($fh, '123'); var_dump(ftell($fh)); stream_filter_append($fh, 'zlib.deflate', STREAM_FILTER_WRITE, 9); fwrite($fh, 'abc'); var_dump(ftell($fh)); fseek($fh, 0); var_dump(fread($fh, 1024)); fclose($fh);
Output for 5.6.30 - 7.4.0
int(3) int(3) string(3) "123"