realpath_variation2.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. --TEST--
  2. Test realpath() function : variation
  3. --CREDITS--
  4. Dave Kelsey <d_kelsey@uk.ibm.com>
  5. --SKIPIF--
  6. <?php
  7. if(substr(PHP_OS, 0, 3) == 'WIN' )
  8. die("skip Not Valid for Windows");
  9. ?>
  10. --FILE--
  11. <?php
  12. /* Prototype : string realpath(string path)
  13. * Description: Return the resolved path
  14. * Source code: ext/standard/file.c
  15. * Alias to functions:
  16. */
  17. echo "*** Testing realpath() : variation ***\n";
  18. $paths = array('c:\\',
  19. 'c:',
  20. 'c' ,
  21. '\\' ,
  22. '/',
  23. 'c:temp',
  24. 'c:\\/',
  25. '/tmp/',
  26. '/tmp/\\',
  27. '\\tmp',
  28. '\\tmp\\');
  29. foreach($paths as $path) {
  30. echo "\n--$path--\n";
  31. var_dump( realpath($path) );
  32. };
  33. ?>
  34. ===DONE===
  35. --EXPECTF--
  36. *** Testing realpath() : variation ***
  37. --c:\--
  38. bool(false)
  39. --c:--
  40. bool(false)
  41. --c--
  42. bool(false)
  43. --\--
  44. bool(false)
  45. --/--
  46. string(1) "/"
  47. --c:temp--
  48. bool(false)
  49. --c:\/--
  50. bool(false)
  51. --/tmp/--
  52. string(%d) %s/tmp"
  53. --/tmp/\--
  54. bool(false)
  55. --\tmp--
  56. bool(false)
  57. --\tmp\--
  58. bool(false)
  59. ===DONE===