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