PHP 4.0 Bug #5192: opendir fails in 4.0.0 where 3.0.12 worked
| From: | whit at transpect dot com | Date: | Thu, 22 Jun 2000 16:07:50 +0000 |
| Subject: | PHP 4.0 Bug #5192: opendir fails in 4.0.0 where 3.0.12 worked | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-22078@lists.php.net to get a copy of this message | ||
From: whit@transpect.com
Operating system: Linux
PHP version: 4.0.0 Release
PHP Bug Type: Misbehaving function
Bug description: opendir fails in 4.0.0 where 3.0.12 worked
I haven't had time to fully diagnose this, because the PHP site said "Upgrade to 4, there
are very few incompatibilities." So I tried it on a busy day, and ran into a major
incompatibility (from my perspective). There are a number of scripts where I have statements like
"opendir("$docroot/$pgfrom");", where $docroot is an absolute path given at the
top of the file, and $pgfrom is a subdirectory with a name derrived referring page. In php4, this
statement produces an error, to the effect that "1 is not a valid" something-or-other - I
didn't look long at it because this is a production system, and I had to revert to php3 before
users started seeing all the broken pages.
Now this could be paranoia in php4 on what directories can be openned, or it could be failure to
handle the string concatenation of "$docroot/$pgfrom" the same way (is it performing
division on the two text strings and deciding the result is "1"?) ... or something else.
Whatever it is, it's incompatible with php3, and this should be listed in the incompatibilities
file, along with the programming change(s) required to not break scripts expecting the old behavior.
And until stuff like this is fully documented, you shouldn't be advising everyone to hurry up
and upgrade, imho - or at least warning folks to be thorough about backing up old files, because of
the likelihood of unexpected incompatibilities.
4 does look faster though!