From: hostmaster at uuism dot net
Operating system: Fedora Core 4
PHP version: 5.2CVS-2008-11-01 (snap)
PHP Bug Type: Directory function related
Bug description: rmdir() on non-existent directory has different Warning
wording than test
Description:
------------
rmdir() on non-existent directory produces the response "Warning:
rmdir(temp): Not a directory" that is different than test script
mkdir_rmdir_error.phpt expects: "Warning: rmdir(temp): No such file or
directory"
This is the last statement in the test script.
Jim
Reproduce code:
---------------
<?php
/* Prototype: bool mkdir ( string $pathname [, int $mode [, bool
$recursive [, resource $context]]] );
Description: Makes directory
Prototype: bool rmdir ( string $dirname [, resource $context] );
Description: Removes directory
*/
echo "*** Testing mkdir(): error conditions ***\n";
var_dump( mkdir() ); // args < expected
var_dump( mkdir(1, 2, 3, 4, 5) ); // args > expected
var_dump( mkdir("testdir", 0777, false, $context, "test") ); // args >
expected
echo "\n*** Testing rmdir(): error conditions ***\n";
var_dump( rmdir() ); // args < expected
var_dump( rmdir(1, 2, 3) ); // args > expected
var_dump( rmdir("testdir", $context, "test") ); // args > expected
echo "\n*** Testing rmdir() on non-existent directory ***\n";
var_dump( rmdir("temp") );
echo "Done\n";
?>
Expected result:
----------------
*** Testing mkdir(): error conditions ***
Warning: mkdir() expects at least 1 parameter, 0 given in %s on line %d
bool(false)
Warning: mkdir() expects at most 4 parameters, 5 given in %s on line %d
bool(false)
Notice: Undefined variable: context in %s on line %d
Warning: mkdir() expects at most 4 parameters, 5 given in %s on line %d
bool(false)
*** Testing rmdir(): error conditions ***
Warning: rmdir() expects at least 1 parameter, 0 given in %s on line %d
bool(false)
Warning: rmdir() expects at most 2 parameters, 3 given in %s on line %d
bool(false)
Notice: Undefined variable: context in %s on line %d
Warning: rmdir() expects at most 2 parameters, 3 given in %s on line %d
bool(false)
*** Testing rmdir() on non-existent directory ***
Warning: rmdir(temp): No such file or directory in %s on line %d
bool(false)
Done
Actual result:
--------------
*** Testing mkdir(): error conditions ***
Warning: mkdir() expects at least 1 parameter, 0 given in
/usr/local/src/php5.2-200810312330/ext/standard/tests/file/mkdir_rmdir_error.php
on line 10
bool(false)
Warning: mkdir() expects at most 4 parameters, 5 given in
/usr/local/src/php5.2-200810312330/ext/standard/tests/file/mkdir_rmdir_error.php
on line 11
bool(false)
Notice: Undefined variable: context in
/usr/local/src/php5.2-200810312330/ext/standard/tests/file/mkdir_rmdir_error.php
on line 12
Warning: mkdir() expects at most 4 parameters, 5 given in
/usr/local/src/php5.2-200810312330/ext/standard/tests/file/mkdir_rmdir_error.php
on line 12
bool(false)
*** Testing rmdir(): error conditions ***
Warning: rmdir() expects at least 1 parameter, 0 given in
/usr/local/src/php5.2-200810312330/ext/standard/tests/file/mkdir_rmdir_error.php
on line 15
bool(false)
Warning: rmdir() expects at most 2 parameters, 3 given in
/usr/local/src/php5.2-200810312330/ext/standard/tests/file/mkdir_rmdir_error.php
on line 16
bool(false)
Notice: Undefined variable: context in
/usr/local/src/php5.2-200810312330/ext/standard/tests/file/mkdir_rmdir_error.php
on line 17
Warning: rmdir() expects at most 2 parameters, 3 given in
/usr/local/src/php5.2-200810312330/ext/standard/tests/file/mkdir_rmdir_error.php
on line 17
bool(false)
*** Testing rmdir() on non-existent directory ***
Warning: rmdir(temp): Not a directory in
/usr/local/src/php5.2-200810312330/ext/standard/tests/file/mkdir_rmdir_error.php
on line 20
bool(false)
Done
--
Edit bug report at http://bugs.php.net/?id=46454&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46454&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46454&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46454&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46454&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=46454&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46454&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=46454&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=46454&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=46454&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=46454&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=46454&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46454&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46454&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46454&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46454&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46454&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=46454&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=46454&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=46454&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=46454&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=46454&r=mysqlcfg