1--TEST-- 2pathinfo() tests 3--FILE-- 4<?php 5 6var_dump(pathinfo("")); 7var_dump(pathinfo(".")); 8var_dump(pathinfo("..")); 9var_dump(pathinfo("/")); 10var_dump(pathinfo("./")); 11var_dump(pathinfo("/.")); 12var_dump(pathinfo(".cvsignore")); 13var_dump(pathinfo(__FILE__, PATHINFO_BASENAME)); 14var_dump(pathinfo(__FILE__, PATHINFO_FILENAME)); 15var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION)); 16var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME)); 17var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME)); 18var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_BASENAME)); 19var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME)); 20var_dump(pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_BASENAME)); 21var_dump(pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_DIRNAME)); 22var_dump(pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_BASENAME)); 23var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_EXTENSION)); 24var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_BASENAME)); 25 26echo "Done\n"; 27?> 28--EXPECTF-- 29array(2) { 30 ["basename"]=> 31 string(0) "" 32 ["filename"]=> 33 string(0) "" 34} 35array(4) { 36 ["dirname"]=> 37 string(1) "." 38 ["basename"]=> 39 string(1) "." 40 ["extension"]=> 41 string(0) "" 42 ["filename"]=> 43 string(0) "" 44} 45array(4) { 46 ["dirname"]=> 47 string(1) "." 48 ["basename"]=> 49 string(2) ".." 50 ["extension"]=> 51 string(0) "" 52 ["filename"]=> 53 string(1) "." 54} 55array(3) { 56 ["dirname"]=> 57 string(1) "%e" 58 ["basename"]=> 59 string(0) "" 60 ["filename"]=> 61 string(0) "" 62} 63array(4) { 64 ["dirname"]=> 65 string(1) "." 66 ["basename"]=> 67 string(1) "." 68 ["extension"]=> 69 string(0) "" 70 ["filename"]=> 71 string(0) "" 72} 73array(4) { 74 ["dirname"]=> 75 string(1) "%e" 76 ["basename"]=> 77 string(1) "." 78 ["extension"]=> 79 string(0) "" 80 ["filename"]=> 81 string(0) "" 82} 83array(4) { 84 ["dirname"]=> 85 string(1) "." 86 ["basename"]=> 87 string(10) ".cvsignore" 88 ["extension"]=> 89 string(9) "cvsignore" 90 ["filename"]=> 91 string(0) "" 92} 93string(12) "pathinfo.php" 94string(8) "pathinfo" 95string(3) "php" 96string(%d) "%s%estrings" 97string(%d) "%s%estrings" 98string(12) "pathinfo.php" 99string(3) "php" 100string(12) "pathinfo.php" 101string(%d) "%s%estrings" 102string(12) "pathinfo.php" 103string(%d) "%s%estrings" 104string(%d) "%s%estrings" 105Done 106