PageRenderTime 47ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/hphp/test/zend/bad/ext/standard/tests/file/fwrite.php

http://github.com/facebook/hiphop-php
PHP | 28 lines | 20 code | 8 blank | 0 comment | 0 complexity | 22185a0b46f20eaf2a6c1cb9f042de6e MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
  1. <?php
  2. $filename = dirname(__FILE__)."/fwrite.dat";
  3. $fp = fopen($filename, "w");
  4. var_dump(fwrite($fp));
  5. var_dump(fwrite($fp, array()));
  6. fclose($fp);
  7. $fp = fopen($filename, "r");
  8. var_dump(fwrite($fp, "data"));
  9. $fp = fopen($filename, "w");
  10. var_dump(fwrite($fp, "data", -1));
  11. var_dump(fwrite($fp, "data", 100000));
  12. fclose($fp);
  13. var_dump(fwrite($fp, "data", -1));
  14. var_dump(fwrite(array(), "data", -1));
  15. var_dump(fwrite(array(), "data"));
  16. var_dump(fwrite(array()));
  17. var_dump(file_get_contents($filename));
  18. @unlink($filename);
  19. echo "Done\n";
  20. ?>