--- title: Walk::walk --- Walk::walk — Output generator for walking down the DOM tree ## Description ##
public Walk::walk ( \Closure|null $filter = null ) : \Generator
Non-standard. Creates a [`\Generator`](https://www.php.net/manual/en/class.generator.php) object for walking down the DOM tree. This is in lieu of recreating the awful [DOM TreeWalker API](https://developer.mozilla.org/en-US/docs/Web/API/Treewalker).
## Examples ##
**Example \#1 Print name of every Element**
```php
loadHTML('