public function run(Input $input, OutputInterface $output)
    {
        $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('cli.run.start', $this->exercise, $input));
        $success = true;
        foreach ($this->preserveOldArgFormat($this->exercise->getArgs()) as $i => $args) {
            /** @var CliExecuteEvent $event */
            $event = $this->eventDispatcher->dispatch(
                new CliExecuteEvent('cli.run.student-execute.pre', new ArrayObject($args))
            );

            $args = $event->getArgs();

            if (count($args)) {
                $glue = max(array_map('strlen', $args->getArrayCopy())) > 30 ? "\n" : ', ';

                $output->writeTitle('Arguments');
                $output->write(implode($glue, $args->getArrayCopy()));
                $output->emptyLine();
            }

            $output->writeTitle("Output");
            $process = $this->getPhpProcess($input->getArgument('program'), $args);
            $process->start();
            $this->eventDispatcher->dispatch(
                new CliExecuteEvent('cli.run.student.executing', $args, ['output' => $output])
            );
            $process->wait(function ($outputType, $outputBuffer) use ($output) {
                $output->write($outputBuffer);
            });
            $output->emptyLine();

            if (!$process->isSuccessful()) {
                $success = false;
            }

            $output->lineBreak();
        }

        $this->eventDispatcher->dispatch(new ExerciseRunnerEvent('cli.run.finish', $this->exercise, $input));
        return $success;
    }