bug77552.phpt 640 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Bug #77552 Uninitialized php_stream_statbuf in stat functions
  3. --SKIPIF--
  4. <?php
  5. if (substr(PHP_OS, 0, 3) != 'WIN') {
  6. die('skip windows only test');
  7. }
  8. ?>
  9. --FILE--
  10. <?php
  11. // Check lstat on a Windows junction to ensure that st_mode is zero
  12. $tmpDir = __DIR__.'/test-bug77552';
  13. $target = $tmpDir.'/folder/target';
  14. mkdir($target, 0777, true);
  15. $junction = $tmpDir.'/junction';
  16. $cmd = sprintf('mklink /J "%s" "%s"', $junction, $target);
  17. exec($cmd);
  18. $stat = lstat($junction);
  19. var_dump($stat['mode']);
  20. ?>
  21. --CLEAN--
  22. <?php
  23. $tmpDir = __DIR__.'/test-bug77552';
  24. $cmd = sprintf('rmdir /S /Q "%s"', $tmpDir);
  25. exec($cmd);
  26. ?>
  27. --EXPECT--
  28. int(0)