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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more