Ask a Question related to PHP Development, Design and Development.
-
phpbugs at localpin dot com #1
#24928 [NEW]: error_log inconsistent in adding newline to files
From: phpbugs at localpin dot com
Operating system: Windows XP Home Edition
PHP version: 4.3.1
PHP Bug Type: Unknown/Other Function
Bug description: error_log inconsistent in adding newline to files
Description:
------------
There is an inconsistency whether error_log gives a newline or not when
sending output, only based upon whether the file is not named (message
type 0) or named explicitly (message type 3).
i.e. when doing "error_log($msg)" a newline is automatically appended, but
when doing "error_log($msg, 3, $myfile)" a newline is not automatically
appended.
e.g. error_log($msg) gives:
1. My msg
2. My msg
3. My msg
4. My msg
but error_log($msg, 3, $another_file) gives:
1. My msg 2. My msg 3. M
y msg 4. My msg
Since in both cases the output is to a file, it seems to me that this is
inconsistent. Either BOTH should give an automatic newline, or NEITHER.
One can even imagine the case where the filename for both is identical
(e.g. both use the file "error.log"), yet because you specify the name of
the file explicitly, you don't get a 'free' newline char.
Reproduce code:
---------------
var $counter = 1;
var $log_elsewhere = true;
var $msg_prefix = "This is test number: ";
var $dev_filename = "c:/Program Files/Apache
Group/Apache/logs/dev_error.log";$elsewhere_log_name =
while (true) {
$msg = $msg_prefix . $counter;
if ($log_elsewhere) {
error_log($fileline, 3, $dev_filename);
// The following line should not be necessary
error_log("\n", 3, $dev_filename);
}
else {
error_log($fileline);
}
$counter++;
}
Expected result:
----------------
Without the extra newline sending, I would like the output to be identical
in both cases.
--
Edit bug report at [url]http://bugs.php.net/?id=24928&edit=1[/url]
--
Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=24928&r=trysnapshot4[/url]
Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=24928&r=trysnapshot5[/url]
Fixed in CVS: [url]http://bugs.php.net/fix.php?id=24928&r=fixedcvs[/url]
Fixed in release: [url]http://bugs.php.net/fix.php?id=24928&r=alreadyfixed[/url]
Need backtrace: [url]http://bugs.php.net/fix.php?id=24928&r=needtrace[/url]
Try newer version: [url]http://bugs.php.net/fix.php?id=24928&r=oldversion[/url]
Not developer issue: [url]http://bugs.php.net/fix.php?id=24928&r=support[/url]
Expected behavior: [url]http://bugs.php.net/fix.php?id=24928&r=notwrong[/url]
Not enough info: [url]http://bugs.php.net/fix.php?id=24928&r=notenoughinfo[/url]
Submitted twice: [url]http://bugs.php.net/fix.php?id=24928&r=submittedtwice[/url]
register_globals: [url]http://bugs.php.net/fix.php?id=24928&r=globals[/url]
PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=24928&r=php3[/url]
Daylight Savings: [url]http://bugs.php.net/fix.php?id=24928&r=dst[/url]
IIS Stability: [url]http://bugs.php.net/fix.php?id=24928&r=isapi[/url]
Install GNU Sed: [url]http://bugs.php.net/fix.php?id=24928&r=gnused[/url]
phpbugs at localpin dot com Guest
-
newline to <br>?
When doing a databse query, how do yu contvert your newlines to <br>? -
adding newline in xml export
I'm using ID CS on win2k and I'm wondering how to add new lines after xml elements that I'm creating. It's saving the whole export on one line. TIA -
Newline in XML
Hello Is there any way to insert new line charcter in an Attribute of XML and let flash read it dinamicaly? Something like this XML-Code ... -
#8314 [Ana]: Setting the error_log = syslog does not work on Win2k
ID: 8314 Updated by: wez@php.net Reported By: zak@php.net Status: Analyzed Bug Type: PHP options/info... -
newline
How can i make a newline in a sprite of a text-member with lingo? THX Wolfgang



Reply With Quote

