1--TEST-- 2Test dirname() function : basic functionality 3--CREDITS-- 4Dave Kelsey <d_kelsey@uk.ibm.com> 5--SKIPIF-- 6<?php 7if(substr(PHP_OS, 0, 3) == "WIN") 8 die("skip Not valid for Windows"); 9?> 10--FILE-- 11<?php 12echo "*** Testing dirname() : basic functionality ***\n"; 13 14 15// Initialise all required variables 16$paths = array( 17 '', 18 ' ', 19 'c:', 20 'c:\\', 21 'c:/', 22 'afile', 23 'c:\test\afile', 24 'c:\\test\\afile', 25 'c://test//afile', 26 'c:\test\afile\\', 27 '/usr/lib/locale/en_US', 28 '//usr/lib//locale/en_US', 29 '\\', 30 '\\\\', 31 '/', 32 '//', 33 '///', 34 '/usr/lib/locale/en_US/', 35 'c:\windows/system32\drivers/etc\hosts', 36 '/usr\lib/locale\en_US', 37 ' c:\test\adir\afile.txt', 38 'c:\test\adir\afile.txt ', 39 ' c:\test\adir\afile.txt ', 40 ' /usr/lib/locale/en_US', 41 '/usr/lib/locale/en_US ', 42 ' /usr/lib/locale/en_US ', 43 ' c:', 44 ' c:\test\adir\afile.txt', 45 '/usr', 46 '/usr/' 47 ); 48 49foreach ($paths as $path) { 50 var_dump( dirname($path) ); 51} 52 53?> 54--EXPECT-- 55*** Testing dirname() : basic functionality *** 56string(0) "" 57string(1) "." 58string(1) "." 59string(1) "." 60string(1) "." 61string(1) "." 62string(1) "." 63string(1) "." 64string(8) "c://test" 65string(1) "." 66string(15) "/usr/lib/locale" 67string(17) "//usr/lib//locale" 68string(1) "." 69string(1) "." 70string(1) "/" 71string(1) "/" 72string(1) "/" 73string(15) "/usr/lib/locale" 74string(27) "c:\windows/system32\drivers" 75string(8) "/usr\lib" 76string(1) "." 77string(1) "." 78string(1) "." 79string(18) " /usr/lib/locale" 80string(15) "/usr/lib/locale" 81string(18) " /usr/lib/locale" 82string(1) "." 83string(1) "." 84string(1) "/" 85string(1) "/" 86