Skip to content

Instantly share code, notes, and snippets.

@cmb69
Created August 26, 2016 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmb69/6a644d70b8019cf49d3dad4753b657dc to your computer and use it in GitHub Desktop.
Save cmb69/6a644d70b8019cf49d3dad4753b657dc to your computer and use it in GitHub Desktop.
<?php
$name = "/tmp/hello.txt.gz";
$file = "compress.zlib://" . $name;
$stream = fopen($file, 'w');
var_dump(flock($stream, LOCK_EX));
fputs($stream, 'hello');
fclose($stream);
var_dump(filesize($name));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment