#22105 [Fbk->NoF]: mkdir changes the variable passed to it
| From: | sniper@php.net | Date: | Thu, 20 Feb 2003 14:09:46 +0000 |
| Subject: | #22105 [Fbk->NoF]: mkdir changes the variable passed to it | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-33711@lists.php.net to get a copy of this message | ||
ID: 22105
Updated by: sniper@php.net
Reported By: bram at smartelectronix dot com
-Status: Feedback
+Status: No Feedback
Bug Type: Directory function related
Operating System: Linux
PHP Version: 4.2.2
New Comment:
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
Previous Comments:
------------------------------------------------------------------------
[2003-02-07 19:42:50] iliaa@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2003-02-07 04:39:47] bram at smartelectronix dot com
$tmp = "xx/yy";
$parts = explode("/",$tmp);
for($i=0;$i<count($parts);$i++)
{
$directory = 'files'; //my base-dir
//strange loop to show the error
for($j=0;$j<=$i;$j++)
$directory = $directory . '/' . $parts[$j];
echo 'before :: ' . $directory . '<br>';
@mkdir($directory,0775);
echo 'after :: ' . $directory . '<br>';
}
outputs:
before :: files/xx
after :: files/xx
before :: files/xx/yy
after :: files/xxyy
The last line has the error.
As you can see mkdir() changes the variable.
Even if the rest of the code is buggy ( ;) )
this shouldn't happen :)
- bram
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22105&edit=1