If you are writing a command line tool in PHP and want to write to STDERR, here is the command:
file_put_contents('php://stderr', 'This text goes to STDERR');
The relevant documentation page is PHP input/output streams.
P.S. I actually wanted to reply to this page, but there was no way to leave a comment there…
January 20, 2011 at 9:48 pm
Hi, that’s my page that allows no comments. I used to have commenting through haloscan, but they shut down (or at least shut down their free service). Setting up Disqus has been on my to-do list for a long time.
Thanks for the tip on file_put_contents()! I’ll update my page.