1--TEST-- 2Test pathinfo() function : usage variation 3--CREDITS-- 4Dave Kelsey <d_kelsey@uk.ibm.com> 5--FILE-- 6<?php 7echo "*** Testing pathinfo() : usage variation ***\n"; 8 9$testfile = "/usr/include/arpa/inet.h"; 10 11var_dump(pathinfo("./")); 12var_dump(pathinfo("/.")); 13var_dump(pathinfo(".cvsignore")); 14var_dump(pathinfo($testfile, PATHINFO_BASENAME)); 15var_dump(pathinfo($testfile, PATHINFO_FILENAME)); 16var_dump(pathinfo($testfile, PATHINFO_EXTENSION)); 17var_dump(pathinfo($testfile, PATHINFO_DIRNAME)); 18var_dump(pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME)); 19var_dump(pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_BASENAME)); 20var_dump(pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME)); 21var_dump(pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_BASENAME)); 22var_dump(pathinfo($testfile, PATHINFO_FILENAME|PATHINFO_DIRNAME)); 23var_dump(pathinfo($testfile, PATHINFO_FILENAME|PATHINFO_BASENAME)); 24var_dump(pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_EXTENSION)); 25var_dump(pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_BASENAME)); 26 27 28?> 29--EXPECTF-- 30*** Testing pathinfo() : usage variation *** 31array(4) { 32 ["dirname"]=> 33 string(1) "." 34 ["basename"]=> 35 string(1) "." 36 ["extension"]=> 37 string(0) "" 38 ["filename"]=> 39 string(0) "" 40} 41array(4) { 42 ["dirname"]=> 43 string(1) "%s" 44 ["basename"]=> 45 string(1) "." 46 ["extension"]=> 47 string(0) "" 48 ["filename"]=> 49 string(0) "" 50} 51array(4) { 52 ["dirname"]=> 53 string(1) "." 54 ["basename"]=> 55 string(10) ".cvsignore" 56 ["extension"]=> 57 string(9) "cvsignore" 58 ["filename"]=> 59 string(0) "" 60} 61string(6) "inet.h" 62string(4) "inet" 63string(1) "h" 64string(17) "/usr/include/arpa" 65string(17) "/usr/include/arpa" 66string(6) "inet.h" 67string(1) "h" 68string(6) "inet.h" 69string(17) "/usr/include/arpa" 70string(6) "inet.h" 71string(17) "/usr/include/arpa" 72string(17) "/usr/include/arpa" 73