Re: Re: PHP 4.0 Bug #5192 Updated: opendir fails in 4.0.0 where 3.0.12 worked
| From: | Whit | Date: | Tue, 27 Jun 2000 17:23:56 +0000 |
| Subject: | Re: Re: PHP 4.0 Bug #5192 Updated: opendir fails in 4.0.0 where 3.0.12 worked | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-22512@lists.php.net to get a copy of this message | ||
On Tue, Jun 27, 2000 at 08:00:59PM +0300, Stanislav Malyshev wrote:
> W>> $chk="$comdir"."/"."$id";
> W>> if(is_dir("$chk")) {
> W>> opendir("$chk");
> W>> $fil=readdir();
>
> Please read the manual. Opendir retrns handle. You should use it with
> readdir.
My point then is this: The function has different requirements that php3
did. People who've been using php since early '94, as I have, do not go back
through our scripts and re-read each manual entry for every function we call
in our working codebase. It may well be that the spec for readdir() changed
in the manual before php4 - I just don't know - but the important thing is
the functionality remained compatible with scripts written to prior
iterations of the specs until it was broken in php4 - and you really should
list this as an incompatibility in php4, that folks who've used opendir()
may need to modify it, or php4 will break.
My use of readdir() is probably based on the php2 manual - but again my
point is php3 didn't break it in actual use, php4 did: it's a real
difference in php4. Please put this warning on the php Website. Even better:
please fix the function in the next iteration so that readdir() will default
to working as before when a handle is not specified. After all, it would
appear to be an explicit goal of the project to maximize backwards
compatibility, right?
Have other functions have been changed in ways that will break things, if
people haven't carefully studied prior changes in the specs that were not
enforced in the code up until now?
Thanks for your attention to this.
\/\/ I-I I T
Blauvelt
whit@transpect.com