SplFileObject_fwrite_variation_001.phpt 491 B

123456789101112131415161718192021
  1. --TEST--
  2. SplFileObject::fwrite function - writing with two parameters length < input string length
  3. --FILE--
  4. <?php
  5. $file = dirname(__FILE__).'/SplFileObject_fwrite_variation_001.txt';
  6. if(file_exists($file)) {
  7. unlink($file);
  8. }
  9. $obj = New SplFileObject($file,'w');
  10. $obj->fwrite('test_write',4);
  11. var_dump(file_get_contents($file));
  12. ?>
  13. --CLEAN--
  14. <?php
  15. $file = dirname(__FILE__).'/SplFileObject_fwrite_variation_001.txt';
  16. if(file_exists($file)) {
  17. unlink($file);
  18. }
  19. ?>
  20. --EXPECT--
  21. string(4) "test"