r/PHPhelp • • Oct 19 '26

Symfony Console: Stderr?

/r/symfony/comments/1xa951k/symfony_console_stderr/
1 Upvotes

1 comment sorted by

1

u/SoftwareNegative8783 Oct 20 '26

getErrorOutput() only exists on ConsoleOutputInterface, not OutputInterface. So check `$output instanceof ConsoleOutputInterface` first. In CommandTester, set the option `capture_stderr_separately` to true, then call getErrorOutput() on the tester.