RemexHtml/Tokenizer/Tokenizer.php
protected function handleAsciiErrors( $mask, $text, $offset, $length, $sourcePos ) {
		while ( $length > 0 ) {
			$validLength = strcspn( $text, $mask, $offset, $length );
			$offset += $validLength;
			$length -= $validLength;
			if ( $length <= 0 ) {
				break;
			}
			$char = $text[$offset];
			$codepoint = ord( $char );
			if ( $codepoint < 0x20 || $codepoint >= 0x7f ) {
				$this->error( sprintf( 'unexpected U+00%02X', $codepoint ), $offset + $sourcePos );
			} else {
				$this->error( "unexpected \"$char\"", $offset + $sourcePos );
			}
			$offset++;
			$length--;
		}
	}
protected function handleAsciiErrors( $mask, $text, $offset, $length, $sourcePos ) {
		while ( $length > 0 ) {
			$validLength = strcspn( $text, $mask, $offset, $length );
			$offset += $validLength;
			$length -= $validLength;
			if ( $length <= 0 ) {
				break;
			}
			$char = $text[$offset];
			$codepoint = ord( $char );
			if ( $codepoint < 0x20 || $codepoint >= 0x7f ) {
				$this->error( sprintf( 'unexpected U+00%02X', $codepoint ), $offset + $sourcePos );
			} else {
				$this->error( "unexpected \"$char\"", $offset + $sourcePos );
			}
			$offset++;
			$length--;
		}
	}
protected function handleAsciiErrors ( $ mask , $ text , $ offset , $ length , $ sourcePos ) { while ( $ length > 0 ) { $ validLength = strcspn ( $ text , $ mask , $ offset , $ length ) ; $ offset += $ validLength ; $ length -= $ validLength ; if ( $ length <= 0 ) { break ; } $ char = $ text [ $ offset ] ; $ codepoint = ord ( $ char ) ; if ( $ codepoint < 0x20 || $ codepoint >= 0x7f ) { $ this -> error ( sprintf ( 'unexpected U+00%02X' , $ codepoint ) , $ offset + $ sourcePos ) ; } else { $ this -> error ( "unexpected \"$char\"" , $ offset + $ sourcePos ) ; } $ offset ++ ; $ length -- ; } }
Generic helper for points in the spec which say that an error should
be issued when certain ASCII characters are seen, with no other action
taken.

@param string $mask Mask for strcspn
@param string $text The input text
@param int $offset The start of the range within $text to search
@param int $length The length of the range within $text to search
@param int $sourcePos The offset within the input text corresponding
to $text, for error position reporting.
Generic helper for points in the spec which say that an error should be issued when certain ASCII characters are seen with no other action taken .