-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Symfony version(s) affected: 3.4
Description
Problem with stdout in class SymfonyQuestionHelper with multichoice
How to reproduce
<?php
require_once 'vendor/autoload.php';
use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Component\Console\Question\ChoiceQuestion;
$in = new ArgvInput();
$out = new ConsoleOutput();
$dialog = new SymfonyQuestionHelper();
$heroes = ['Русский' => 'russian', 'żółw' => 'bar', 'super' => 'Superman'];
$question = new ChoiceQuestion('What is your favorite superhero?', $heroes, 'super');
$question->setMultiselect(true);
$res = $dialog->ask($in, $out, $question);
And output
> php test.php
What is your favorite superhero? [Superman]:
[Русский] russian
[żółw ] bar
[super ] Superman
> super
But should be (Look at right brackets)
> php test.php
What is your favorite superhero? [Superman]:
[Русский] russian
[żółw ] bar
[super ] Superman
> super