WordPress 7.1 shipped the first two runnable code examples in the Code Reference. They are powered by WordPress Playground, and more are coming in 7.2.
On the WP_HTML_Processor::class_list() Code Reference page, select Run button in the code snippet and the code example will run right there, in your browser.
Runnable snippets can be defined in the DocBlock of each method directly in the WordPress codebase. They use a slightly different syntax from the regular code examples:
<?php /** * Generator for a foreach loop to step through each class name for the matched tag.
Click here to continue reading this article.
