ID: 28643 User updated by: key at kemcity dot ru -Summary: __LINE__ miscounts by several lines [script without a # sign at the top] Reported By: key at kemcity dot ru Status: Bogus Bug Type: Scripting Engine problem Operating System: possibly any PHP Version: Irrelevant New Comment:
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); Previous Comments: ------------------------------------------------------------------------ [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 ;))) ------------------------------------------------------------------------ [2004-06-05 16:41:56] key at kemcity dot ru Ok. Try the next urls: http://soft.kemcity.ru/test/index.htm or http://users.info.kuzbass.net/~key/test/index.htm Direct Links: Test1 http://soft.kemcity.ru/test/index1.php or http://users.info.kuzbass.net/~key/test/index1.php Test2 http://soft.kemcity.ru/test/index2.php or http://users.info.kuzbass.net/~key/test/index2.php Source Code1: http://soft.kemcity.ru/test/index1.txt or http://users.info.kuzbass.net/~key/test/index1.txt Source Code2: http://soft.kemcity.ru/test/index1.txt or http://users.info.kuzbass.net/~key/test/index1.txt ------------------------------------------------------------------------ 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