WP_HTML_Processor::bail( string $message ): never
- Since
- 6.7.0
- Source
wp-includes/html-api/class-wp-html-processor.php:596
Compatibility
- WordPress
- since 6.7.0
- PHP
- 7.4–8.6-dev
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.
Parameters
$messagestring- Explains support is missing in order to parse the current node.
Return value
never
Performance profile
How much work a call to WP_HTML_Processor::bail() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.
- Cost class
- Light
- Scaling
- Scales with input
- Instructions
- 45–47
- Plugin surface
- None
- Called by
- 16
Touches nothing outside its own arguments.
The body loops, so the work grows with what you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 55.
Nothing here hands control to plugin code.
16 places in core call this, so the cost is paid more often than your own code shows.
What one call costs · 1 distinct outcome
One number would be a lie: the work depends on which branch runs. These are every distinct cost WP_HTML_Processor::bail() can have, taken from its control-flow graph on PHP 8.5.
| When | Instructions | Calls it makes |
|---|---|---|
| always | 45–47 | ->walk_down() |
Across PHP versions
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 55 | 45–47 | 4 | |
| 8.5 | 55 | 45–47 | 4 | |
| 8.4 | 55 | 45–47 | 4 | 4 fewer instructions than PHP 8.3 |
| 8.3 | 59 | 49–51 | 4 | |
| 8.2 | 59 | 49–51 | 4 | |
| 8.1 | 59 | 49–51 | 4 | |
| 7.4 | 59 | 49–51 | 4 |
An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.
Uses · 1
- WP_HTML_Unsupported_Exception::__construct()Constructor function.
Used by · 16
- WP_HTML_Processor::in_body_any_other_end_tag()Applies the "any other end tag" parsing instructions for the IN BODY insertion mode.
- WP_HTML_Processor::is_html_integration_point()Indicates if the current token is an HTML integration point.
- WP_HTML_Processor::reconstruct_active_formatting_elements()Reconstructs the active formatting elements.
- WP_HTML_Processor::run_adoption_agency_algorithm()Runs the adoption agency algorithm.
- WP_HTML_Processor::step()Steps through the HTML document and stop at the next tag, if any.
- WP_HTML_Processor::step_after_after_body()Parses next element in the 'after after body' insertion mode.
- WP_HTML_Processor::step_after_after_frameset()Parses next element in the 'after after frameset' insertion mode.
- WP_HTML_Processor::step_after_body()Parses next element in the 'after body' insertion mode.
- WP_HTML_Processor::step_after_frameset()Parses next element in the 'after frameset' insertion mode.
- WP_HTML_Processor::step_after_head()Parses next element in the 'after head' insertion mode.
- WP_HTML_Processor::step_in_body()Parses next element in the 'in body' insertion mode.
- WP_HTML_Processor::step_in_foreign_content()Parses next element in the 'in foreign content' insertion mode.
Show all 16
- WP_HTML_Processor::step_in_frameset()Parses next element in the 'in frameset' insertion mode.
- WP_HTML_Processor::step_in_head()Parses next element in the 'in head' insertion mode.
- WP_HTML_Processor::step_in_table()Parses next element in the 'in table' insertion mode.
- WP_HTML_Processor::step_in_table_text()Parses next element in the 'in table text' insertion mode.
Source code
private function bail( string $message ) { $here = $this->bookmarks[ $this->state->current_token->bookmark_name ]; $token = substr( $this->html, $here->start, $here->length ); $open_elements = array(); foreach ( $this->state->stack_of_open_elements->stack as $item ) { $open_elements[] = $item->node_name; } $active_formats = array(); foreach ( $this->state->active_formatting_elements->walk_down() as $item ) { $active_formats[] = $item->node_name; } $this->last_error = self::ERROR_UNSUPPORTED; $this->unsupported_exception = new WP_HTML_Unsupported_Exception( $message, $this->state->current_token->node_name, $here->start, $token, $open_elements, $active_formats ); throw $this->unsupported_exception; }Changelog
Introduced in 6.7.0. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
none to never.verified against sourceAbout this page
- Parsed data
- Generated from the wordpress-develop 7.1.0 tag, from
src/wp-includes/html-api/class-wp-html-processor.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it. - Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.