ID: 28643
User updated by: key at kemcity dot ru
-Summary: __LINE__ miscounts in spite of using not \r\n as a
newline
Reported By: key at kemcity dot ru
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: possibly any
PHP Version: Irrelevant
New Comment:
I suppose, nobody helps me ;) I hope others are awared of this bug and
would find it at google, for example. Because I couldn't.
Previous Comments:
------------------------------------------------------------------------
[2004-06-05 18:13:13] key at kemcity dot ru
For my followers:
to change the script appropriate the requirements, you should replace
any occurence of "wrong" newline. I used the next simple script:
$filenameIn="funct.php";
$filenameOut="funct.out.php";
$x=fopen($filenameIn,"r");
$buf=fread($x,filesize($filenameIn));
fclose($x);
$buf=preg_replace("/\r([^\n])/si","\r\n$1",$buf);
$buf=preg_replace("/([^\r])\n/si","$1\r\n",$buf);
$x=fopen($filenameOut,"w+");
fwrite($x,$buf);
fclose($x);
------------------------------------------------------------------------
[2004-06-05 16:55:41] key at kemcity dot ru
not any but every.
Excuse me for a lot of msgs.
------------------------------------------------------------------------
[2004-06-05 16:54:42] key at kemcity dot ru
Only after changing any $0d to $0d$0a I've got right result. So, the
right definition is: use only $0d$0a in your scripts to get right
__LINE__ count. Am I right?
------------------------------------------------------------------------
[2004-06-05 16:52:09] key at kemcity dot ru
I've changed all newlines in file to $0d. There is no any $0a in file.
Is this a solution? Error still out. Check the
http://soft.kemcity.ru/test/index3.php and
http://soft.kemcity.ru/test/index3.txt (source)
------------------------------------------------------------------------
[2004-06-05 16:44:42] key at kemcity dot ru
ok. I'll try,. Thanks for solution. It was a pleasure to get the answer
so soon. ;) And anyway I can't understand why I can't use the
deffierent kind of newline symbol ;)))
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/28643
--
Edit this bug report at http://bugs.php.net/?id=28643&edit=1