ID: 43248 Updated by: [EMAIL PROTECTED] Reported By: carsten_sttgt at gmx dot de -Status: Assigned +Status: Closed Bug Type: Filesystem function related Operating System: Windows_NT PHP Version: 5.2.5 Assigned To: dmitry New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2007-11-11 19:09:23] carsten_sttgt at gmx dot de Description: ------------ Hello, regarding Bug #42778, I think should give a better explanation, why there was a break in backward compatibility in the function realpath() on windows between PHP 5.2.3 and 5.2.4, without any information in the manual or changelog. Additional, in the manual you can read: | The resulting path will have no symbolic link, | '/./' or '/../' components. A "/./" as last component in a path, is the same as "/" as last component. And thus the last "/" must be removed. As you can see, the results with PHP 4.4.7(Win), PHP <=5.2.3(Win) and PHP 5.2.5(FreeBSD) are the same and like descriped in the manual. Only with PHP >=5.2.3(Win) you have a different result. The DirectoryIterator also have the same behaviour with all OS and versions. (BTW: With Perl or VBS I have also no trailing slash on Windows) Regards, Carsten BTW: You should not forget: For an PHP programer it's necessary, to have the same results in PHP functions between PHP versions and operating systems. (especially without informations) Reproduce code: --------------- Testscripts are executed with (in the given dirs): $ .\php -n test.php Testscript 1 in C:\php5 <?php echo realpath('extras\\mibs\\'); ?> Testscript 2 in C:\php4 <?php echo realpath('extras\\mibs\\'); ?> Testscript 3 in C:\php5 <?php $dir = new DirectoryIterator('extras\\mibs\\'); echo $dir->getRealPath(); ?> Testscripts are executed with (in the given dirs): $ ./php -n test.php Testscript 4 in /usr/local/bin (with FreeBSD) <?php echo realpath('../include/'); ?> Testscript 5 in /usr/local/bin (with FreeBSD) <?php $dir = new DirectoryIterator('../include/'); echo $dir->getRealPath(); ?> Expected result: ---------------- on Windows with PHP5: C:\php5\extras\mibs on Windows with PHP4: C:\php4\extras\mibs on FreeBSD: /usr/local/include Actual result: -------------- Testscript 1 with PHP 5.2.3: C:\php5\extras\mibs Testscript 2 with PHP 4.4.7 (Win): C:\php4\extras\mibs Testscript 1 with PHP 5.2.4 (Win): C:\php5\extras\mibs\ Testscript 1 with PHP 5.2.5 (Win): C:\php5\extras\mibs\ Testscript 3 with PHP 5.2.5 (Win): C:\php5\extras\mibs Testscript 4 with PHP 5.2.5 (FreeBSD): /usr/local/include Testscript 5 with PHP 5.2.5 (FreeBSD): /usr/local/include ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43248&edit=1