From: [EMAIL PROTECTED] Operating system: Any PHP version: 4.1.0 PHP Bug Type: Unknown/Other Function Bug description: dirname fix broke behaviour that it had since PHP 3
I was trying to test PHP 4.1.0 in a production site that I have that is made of large code base and realized that dirname original behaviour was broken severely. The site exists for more than 2 years and always relied on the behaviour that dirname("/index.php") would return "" as it has been since PHP 3. The site has 4.0.0 and was never upgraded since because I have this policy of not installing minor versions to avoid spending a lot of time maintaining changes that are caused by bugs that may have been introduced. I investigated and it seems that in PHP 4.0.3, Andi fixed dirname so that dirname("/index.php") now returns "/" instead of "" as before. Although this should have been probably the original behaviour of the function, the fact is that it wasn't not even in PHP 3 days. My site heavily relies on this feature to let scripts realize in which directory they are relatively to the server document root using dirname(GetEnv("SCRIPT_NAME")) . So, my site is seriously broken because I use this everywhere in the site. I talked with Andi and he is not willing to restore the original behaviour because the fix was done more than 1 year ago. So, I propose that some option be added to php.ini that lets developers restore the original behaviour so that their sites don't break because of this change. I also would like to recommend PHP developers to take more care when making these changes that break the existing PHP code base of PHP users because many ISP are refusing to upgrade to more recent versions because it breaks their clients PHP code and they would be loosing business if they would upgrade to a newer version. Please consider this proposal carefully to avoid being accused of unprofessionalism of not assuring backwards compatibility of PHP functions behaviour. -- Edit bug report at: http://bugs.php.net/?id=14538&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]