Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion performance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,16 @@ All events that don't belong to any named section are added to the special secti
called ``__root__``. This way you can get all stopwatch events, even if you don't
know their names, as follows::

foreach($this->stopwatch->getSectionEvents('__root__') as $event) {
use Symfony\Component\Stopwatch\Stopwatch;

foreach($this->stopwatch->getSectionEvents(Stopwatch::ROOT) as $event) {
echo (string) $event;
}

.. versionadded:: 7.2

The ``Stopwatch::ROOT`` constant as a shortcut for ``__root__`` was introduced in Symfony 7.2.

Learn more
----------

Expand Down