Warning: You are browsing the documentation for Symfony 2.5, which is no longer maintained.

Read the updated version of this page for Symfony 5.3 (the current stable version).

Progress Helper

Progress Helper

New in version 2.3: The setCurrent method was introduced in Symfony 2.3.

New in version 2.4: The clear method was introduced in Symfony 2.4.


The Progress Helper was deprecated in Symfony 2.5 and will be removed in Symfony 3.0. You should now use the Progress Bar instead which is more powerful.

When executing longer-running commands, it may be helpful to show progress information, which updates as your command runs:


To display progress details, use the Symfony\Component\Console\Helper\ProgressHelper, pass it a total number of units, and advance the progress as your command executes:

$progress = $this->getHelper('progress');

$progress->start($output, 50);
$i = 0;
while ($i++ < 50) {
    // ... do some work

    // advances the progress bar 1 unit



You can also set the current progress by calling the setCurrent() method.

If you want to output something while the progress bar is running, call clear() first. After you’re done, call display() to show the progress bar again.

The appearance of the progress output can be customized as well, with a number of different levels of verbosity. Each of these displays different possible items - like percentage completion, a moving progress bar, or current/total information (e.g. 10/50):

// the default value

You can also control the different characters and the width used for the progress bar:

// the finished part of the bar
// the unfinished part of the bar
$progress->setEmptyBarCharacter(' ');

To see other available options, check the API documentation for Symfony\Component\Console\Helper\ProgressHelper.


For performance reasons, be careful if you set the total number of steps to a high number. For example, if you’re iterating over a large number of items, consider setting the redraw frequency to a higher value by calling setRedrawFrequency(), so it updates on only some iterations:

$progress->start($output, 50000);

// updates every 100 iterations

$i = 0;
while ($i++ < 50000) {
    // ... do some work


This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.