filter = stream_filter_append(STDOUT, 'agent_output_capture', STREAM_FILTER_WRITE) ?: null; } protected function silenceStderr(): void { stream_filter_append(STDERR, 'agent_output_null', STREAM_FILTER_WRITE); } protected function saveStdout(): void { $execution = Execution::current(); $execution->stdout = fopen('php://stdout', 'w') ?: STDOUT; } }