We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 99b4885 commit fd7b1b0Copy full SHA for fd7b1b0
src/Symfony/Component/Console/Output/ConsoleOutput.php
@@ -153,14 +153,18 @@ private function openOutputStream()
153
return fopen('php://output', 'w');
154
}
155
156
- return @fopen('php://stdout', 'w') ?: fopen('php://output', 'w');
+ return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w'));
157
158
159
/**
160
* @return resource
161
*/
162
private function openErrorStream()
163
{
164
- return fopen($this->hasStderrSupport() ? 'php://stderr' : 'php://output', 'w');
+ if (!$this->hasStderrSupport()) {
165
+ return fopen('php://output', 'w');
166
+ }
167
+
168
+ return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w'));
169
170
0 commit comments