ID:               21755
 Comment by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Bogus
 Bug Type:         *Directory/Filesystem functions
 Operating System: Linux
 PHP Version:      4.3.0
 New Comment:

Someone may want to correct the documentation for these functions as
they CLAIM to support both \ and /.


Previous Comments:
------------------------------------------------------------------------

[2003-01-19 17:44:47] [EMAIL PROTECTED]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

On *nix \ is not a directory separator.

------------------------------------------------------------------------

[2003-01-19 13:33:08] [EMAIL PROTECTED]

test script:
<?php
// windows
$path_win = 'C:\WINNT\anything.txt';
echo "\n".'dirname("'.$path_win.'"):'."\n";
var_dump(dirname($path_win));
echo "\n".'basename("'.$path_win.'"):'."\n";
var_dump(basename($path_win));
echo "\n".'pathinfo("'.$path_win.'"):'."\n";
var_dump(pathinfo($path_win));

// *nix
$path_nix = '/etc/anything.conf';
echo "\n".'dirname("'.$path_nix.'"):'."\n";
var_dump(dirname($path_nix));
echo "\n".'basename("'.$path_nix.'"):'."\n";
var_dump(basename($path_nix));
echo "\n".'pathinfo("'.$path_nix.'"):'."\n";
var_dump(pathinfo($path_nix));
?>

output:

dirname("C:\WINNT\anything.txt"):
string(1) "."

basename("C:\WINNT\anything.txt"):
string(21) "C:\WINNT\anything.txt"

pathinfo("C:\WINNT\anything.txt"):
array(3) {
  ["dirname"]=>
  string(1) "."
  ["basename"]=>
  string(21) "C:\WINNT\anything.txt"
  ["extension"]=>
  string(3) "txt"
}

dirname("/etc/anything.conf"):
string(4) "/etc"

basename("/etc/anything.conf"):
string(13) "anything.conf"

pathinfo("/etc/anything.conf"):
array(3) {
  ["dirname"]=>
  string(4) "/etc"
  ["basename"]=>
  string(13) "anything.conf"
  ["extension"]=>
  string(4) "conf"
}

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=21755&edit=1

Reply via email to