wppaste
WordPress

WP_HTML_Span

Since
6.2.0, 6.5.0
Source
wp-includes/html-api/class-wp-html-span.php:25
Core class used by the HTML tag processor to represent a textual span inside an HTML document.

Description

This is a two-tuple in disguise, used to avoid the memory overhead involved in using an array for the same purpose.

This class is for internal usage of the WP_HTML_Tag_Processor class.

Compatibility

WordPress
since 6.5.0
  • 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).

Properties · 2

$startintpublic
Byte offset into document where span begins.
$lengthintpublic
Byte length of this span.

Methods · 1

Source code

class WP_HTML_Span {	/**	 * Byte offset into document where span begins.	 *	 * @since 6.2.0	 *	 * @var int	 */	public $start; 	/**	 * Byte length of this span.	 *	 * @since 6.5.0	 *	 * @var int	 */	public $length; 	/**	 * Constructor.	 *	 * @since 6.2.0	 *	 * @param int $start  Byte offset into document where replacement span begins.	 * @param int $length Byte length of span.	 */	public function __construct( int $start, int $length ) {		$this->start  = $start;		$this->length = $length;	}}

Changelog

Introduced in 6.2.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

6.5.0
Replaced end with length to more closely align with substr().from the docblock
6.2.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/html-api/class-wp-html-span.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.