#26427 [Opn->Asn]: fopen text-mode does not play nicely with heredoc

From: Date: Thu, 27 Nov 2003 06:01:01 +0000
Subject: #26427 [Opn->Asn]: fopen text-mode does not play nicely with heredoc
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-51137@lists.php.net to get a copy of this message
ID: 26427 Updated by: sniper@php.net Reported By: phpbug at lapage dot com -Status: Open +Status: Assigned -Bug Type: Output Control +Bug Type: Filesystem function related Operating System: Win98 PHP Version: 4.3.2 -Assigned To: +Assigned To: wez New Comment: Assigned to the father of this mode.. Previous Comments: ------------------------------------------------------------------------ [2003-11-26 11:06:28] phpbug at lapage dot com Description: ------------ Writing in text-mode does not play nicely with heredoc, in Win32. Line endings become \r\r\n in the typical situation: php source code with \r\n endings. This will break, for example, batch files written for Win98. Reproduce code: --------------- $fp= fopen('file.txt', 'wt'); fwrite($fp, <<<ENDTEXT One line of text Another line of text Last line of text\n ENDTEXT ); fclose($fp); Expected result: ---------------- One line of text\r\n Another line of text\r\n Last line of text\r\n Actual result: -------------- One line of text\r\r\n Another line of text\r\r\n Last line of text\r\n ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26427&edit=1

« previous php.bugs (#51137) next »