PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/hphp/test/slow/ext_file/feof_after_fwrite_after_eof.php

https://github.com/xstudio/hhvm
PHP | 21 lines | 18 code | 3 blank | 0 comment | 0 complexity | ae221f023a0c886c75d3e14b6ecbae83 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, BSD-3-Clause, LGPL-2.0, LGPL-2.1
  1. <?php
  2. function main() {
  3. $inputs = array(
  4. 'php://temp',
  5. 'php://memory',
  6. );
  7. foreach ($inputs as $input) {
  8. printf("---%s---\n", $input);
  9. $f = fopen($input, 'r+');
  10. fread($f, 1);
  11. var_dump(feof($f));
  12. fwrite($f, 'foo');
  13. var_dump(feof($f));
  14. fseek($f, 0, SEEK_CUR);
  15. var_dump(feof($f));
  16. }
  17. }
  18. main();