#[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.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Php74
PHP 7.4 — arrow functions, typed properties, spread in array expressions, numeric literal separator.
Php80
PHP 8.0 — match, named arguments, constructor promotion, union types, nullsafe ?->, throw expression, mixed/false/null types.
Php81
PHP 8.1 — enums, readonly properties/parameters, intersection types, first-class callables, never type.
Php82
PHP 8.2 — readonly class (also abstract readonly class), DNF types, true type.
Php83
PHP 8.3 — typed class/enum constants.
Php84
PHP 8.4 — property hooks, asymmetric visibility.
Php85
PHP 8.5 — pipe operator (|>), clone with property overrides, final promoted properties,
asymmetric visibility on static properties.
Php86
PHP 8.6 (unreleased) — partial function application (?/... call-argument placeholders).
Trait Implementations§
Source§impl Clone for PhpVersion
impl Clone for PhpVersion
Source§fn clone(&self) -> PhpVersion
fn clone(&self) -> PhpVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more