Re: Fw: [PHP-DEV] 4.0.6
| From: | Andi Gutmans | Date: | Tue, 08 May 2001 17:58:21 +0000 |
| Subject: | Re: Fw: [PHP-DEV] 4.0.6 | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-54414@lists.php.net to get a copy of this message | ||
At 06:32 PM 5/8/2001 +0300, Boian Bonev wrote:
----- Original Message ----- From: "Boian Bonev" <boian@bonev.com> To: "Dave Jones" <JONESD@mps.ohio-state.edu> Sent: Tuesday, May 08, 2001 6:29 PM Subject: Re: [PHP-DEV] 4.0.6 hi,I think it should interprete "\r\n", "\n" and "\r" (which isn't followed by a "\n") as newlines. AndiAnd also line number don't get incremented if there are no line ends, so all syntax errors are reported as being on line 1. The issue might have never come up if the code used "r" mode for opens rather that "rb", since the file are 'text' files. On platforms that don't used embedded newline characters as the record delimiters, the implementation of fread is responsible for mapping the underlying file format to cannonical form (i.e. \n's delimiting lines).you are partially correct - if we have only 'native' files - yes this is the case. but imagine tons of downloaded code, parts of it originating from *nix others from windows, and parts of them edited so all the three possible combinations are used. perhapse you know that most editors convert line endings only for edited lines not for the whole file. now the task of correctly counting line numbers is not that easy. neighter file conversion is. of course some editors pretend to be that clever to interprete all the three formats - something like greedy eating \n\r|\n|\r in this order... b. forgot to say that php must flawlessly interprete all the combinations provided that it is a platform independant language and never rely on os specific stuff - win php source must work on unix as unix php source on windows...