Enum PhpVersion Copy item path Source #[non_exhaustive]
pub enum PhpVersion {
Php74,
Php80,
Php81,
Php82,
Php83,
Php84,
Php85,
Php86,
}Expand description The PHP language version that code is parsed or printed for.
When set in php_rs_parser::ParseOptions, the parser reports syntax that
requires a higher version. The AST is still produced (the parser recovers),
so callers can always inspect what was parsed.
Ordering is meaningful: Php82 > Php81, etc.
Defaults to PhpVersion::Php85 , the latest released version.
This enum is marked as non-exhaustive Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PHP 7.4 — arrow functions, typed properties, spread in array expressions, numeric literal separator.
PHP 8.0 — match, named arguments, constructor promotion, union types, nullsafe ?->, throw expression, mixed/false/null types.
PHP 8.1 — enums, readonly properties/parameters, intersection types, first-class callables, never type.
PHP 8.2 — readonly class (also abstract readonly class), DNF types, true type.
PHP 8.3 — typed class/enum constants.
PHP 8.4 — property hooks, asymmetric visibility.
PHP 8.5 — pipe operator (|>), clone with property overrides, final promoted properties,
asymmetric visibility on static properties.
PHP 8.6 (unreleased) — partial function application (?/... call-argument placeholders).
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Returns the “default value” for a type.
Read more Formats the value using the given formatter.
Read more Compares and returns the maximum of two values.
Read more Compares and returns the minimum of two values.
Read more Restrict a value to a certain interval.
Read more 🔬 This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range.
Read more This method returns an ordering between
self and
other values if one exists.
Read more Tests less than (for
self and
other) and is used by the
< operator.
Read more Tests less than or equal to (for
self and
other) and is used by the
<= operator.
Read more Tests greater than (for
self and
other) and is used by the
>
operator.
Read more Tests greater than or equal to (for
self and
other) and is used by
the
>= operator.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more Converts the given value to a
String.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.