CompiledPattern
in package
FinalYes
Represents a compiled date pattern.
Tags
Table of Contents
Methods
- __construct() : mixed
- Creates a compiled date pattern.
- format() : string
- Formats a date with this pattern.
- match() : array<int, ParseCapture, 1: string}>|false
- Matches input text and returns captured token values.
Methods
__construct()
Creates a compiled date pattern.
public
__construct(array<int, PatternElement> $elements, array<int, string|TokenRule}> $parseParts) : mixed
Parameters
- $elements : array<int, PatternElement>
-
Compiled pattern elements.
- $parseParts : array<int, string|TokenRule}>
-
Regular-expression fragments and token parse parts in parse order.
format()
Formats a date with this pattern.
public
format(CalendarDate $date, Locale $locale) : string
Parameters
- $date : CalendarDate
-
Date to format.
- $locale : Locale
-
Locale definition.
Return values
string —Formatted date.
match()
Matches input text and returns captured token values.
public
match(string $input) : array<int, ParseCapture, 1: string}>|false
Parameters
- $input : string
-
Input text to match.
Tags
Return values
array<int, ParseCapture, 1: string}>|false —Matched captures and their values, or false if no match.