pub enum PhpVersion {
Php74,
Php80,
Php81,
Php82,
Php83,
Php84,
Php85,
}Expand description
The PHP language version the parser should target.
When a PhpVersion is supplied via crate::parse_versioned, the parser
emits crate::diagnostics::ParseError::VersionTooLow for any 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 supported version).
Variants§
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, DNF types, true type.
Php83
PHP 8.3 — typed class/enum constants.
Php84
PHP 8.4 — abstract readonly class, property hooks, asymmetric visibility.
Php85
PHP 8.5 — pipe operator (|>), clone with property overrides, final promoted properties,
asymmetric visibility on static properties.
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 moreSource§impl Debug for PhpVersion
impl Debug for PhpVersion
Source§impl Default for PhpVersion
impl Default for PhpVersion
Source§fn default() -> PhpVersion
fn default() -> PhpVersion
Source§impl Display for PhpVersion
impl Display for PhpVersion
Source§impl Ord for PhpVersion
impl Ord for PhpVersion
Source§fn cmp(&self, other: &PhpVersion) -> Ordering
fn cmp(&self, other: &PhpVersion) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PhpVersion
impl PartialEq for PhpVersion
Source§fn eq(&self, other: &PhpVersion) -> bool
fn eq(&self, other: &PhpVersion) -> bool
self and other values to be equal, and is used by ==.