|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14901 Add a new language construct which prints to stderr by default
Submitted: 2002-01-07 06:05 UTC Modified: 2003-02-06 21:11 UTC
From: mfischer at guru dot josefine dot at Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.1.1 OS: n/a
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mfischer at guru dot josefine dot at
New email:
PHP Version: OS:


 [2002-01-07 06:05 UTC] mfischer at guru dot josefine dot at
A new language construct as a 'friend' to echo wouldn't be a bad idea IMHO. Something like echoerr which prints to stderr instead of stdout (and does not use output buffering of course).

The current situation requires the following steps:

$f = fopen('php://stderr', 'w');
fputs($f, 'debug message');

which is ... well, it's nice to have but cumbersome to use (obviously, I hope).

echo "ene", "mene", str_repeat('bla', '3), "\n";

should just work with echoerr the same:

echoerr "ene", "mene", str_repeat('bla', '3), "\n";

The reason I'm for a language construct:
Make it as similar to use as echo itself. Not requireing it having to use parentheses. Easily to replaceable echo and echoerr.

That's it, flames on.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-06 21:11 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
Thank you for the report, and for helping us make PHP better.

As of PHP 4.3.0 you have STDERR constant that you can use to echo stuff to stderr. Ex.

fwrite(STDERR, "error\n");
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Feb 23 03:01:30 2024 UTC