|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27955 Ctrl-D produces bad output
Submitted: 2004-04-11 18:34 UTC Modified: 2004-04-12 05:44 UTC
From: jkmail at tpg dot com dot au Assigned:
Status: Not a bug Package: Output Control
PHP Version: 5.0.0RC1 OS: FreeBSD 4.9
Private report: No CVE-ID: None
 [2004-04-11 18:34 UTC] jkmail at tpg dot com dot au
When executing this code from STDIN (via CLI), an extra 'D' character appears in the output for the first time the function is executed.

It behaves normally when its reading the code from a file. Could this be the 'D' character from the 'Ctrl-D' combination somehow appearing?

'./configure' '--prefix=/usr/local/php5' '--with-apxs2' '--disable-cgi' '--disable-ipv6' '--with-openssl' '--enable-bcmath' '--with-bzip2' '--with-curl' '--with-gd' '--enable-gd-native-ttf' '--with-imap' '--with-mysql=/usr/local/lib/mysql' '--enable-soap' '--with-xmlrpc' '--with-zlib-dir=/usr'

Reproduce code:
function a() {
	$var = 4;
	print $var . "\n";


Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-11 18:53 UTC] jkmail at tpg dot com dot au
Did a little more testing, and this is more of an input/output issue.

<?= "\n" . 4 . "\n" ?>

PHP4 did not suffer from this issue.
 [2004-04-11 19:27 UTC] jkmail at tpg dot com dot au
Sorry folks,

It just didn't reproduce on linux/php4 (I tested it on linux, as I didn't have php4 installed on the freebsd machine at the time). This seems to be a FreeBSD specific issue. 

This seems to be a problem with other languages like perl as well, so this bug could very well be marked as bogus. I don't like how it messes up the output though. Is there a way we can clear the buffer or something?
 [2004-04-12 05:44 UTC]
Nope, no clue "how to clear a buffer".
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Jul 02 12:05:45 2022 UTC