From: Operating system: Debian Squeeze PHP version: 5.3.9 Package: *Directory/Filesystem functions Bug Type: Feature/Change Request Bug description:mkdir second argument should prepend leading zero if only 3 numbers are inputte
Description: ------------ --- >From manual page: http://www.php.net/function.mkdir#refsect1-function.mkdir- parameters --- It can be **very** easy to omit the leading zero in the permissions argument, especially if working on a command line all day where "775" for example works in a chmod. Although the documentation clearly states it needs a leading zero, it would be good if the function could detect such a trivial error that can lead to quite bad results. It would also help consistency between the linux command line and php. Test script: --------------- <?php mkdir("/tmp/test", 775); // This should be recognised as 0775 are only 3 characters specified Expected result: ---------------- I expect the permissions to be set as "rwxrwxr-x" Actual result: -------------- The permissions are actually set as "r-----r-t" -- Edit bug report at https://bugs.php.net/bug.php?id=60847&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60847&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60847&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60847&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60847&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60847&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60847&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60847&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60847&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60847&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60847&r=support Expected behavior: https://bugs.php.net/fix.php?id=60847&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60847&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60847&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60847&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60847&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60847&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60847&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60847&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60847&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60847&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60847&r=mysqlcfg