Necuima Posted September 10, 2013 Share Posted September 10, 2013 Hi, As noted elsewhere, I have just upgraded to PHP 5.5.3. A script that previously ran perfectly now does not - specifically the file_exists function does not return the correct result. Here's my code: ... $newname = "../works_of_art/large/" . $savename; clearstatcache(); if (!file_exists($newname)) { // an image file with that name does not exist - OK ... The $newname variable has the correct file name in it. The function return indicates that the file exists when it does not! Here's my environment: . Windows 7 Home Premium 64 bit . Internet Explorer 10 . Firefox 22.0 . Dreamweaver CS5 as the text editor . XAMPP for Windows 1.8.3 which comprises: .. Apache 2.4.4 .. PHP 5.5.3 .. MySQL 5.6.11 .. phpMyAdmin 4.0.4 Any guidance will be much appreciated. Thanks, Necuima Link to comment Share on other sites More sharing options...
HartleySan Posted September 10, 2013 Share Posted September 10, 2013 What is the $newname variable equal to? If $savename is not set, then $newname will point to a directory, which may exist. Link to comment Share on other sites More sharing options...
Necuima Posted September 10, 2013 Author Share Posted September 10, 2013 Hi HartleySan, I changed it to: if (file_exists($newname) === FALSE) and now it works correctly:-) Subtle changes between PHP versions! Thanks for your interest. Cheers from Oz. 1 Link to comment Share on other sites More sharing options...
Recommended Posts