Skip to content

0.3.0

Choose a tag to compare

@jorgsowa jorgsowa released this 30 Mar 17:50
· 567 commits to main since this release

New Features

PHP Version System

  • New PhpVersion enum covering PHP 8.0–8.5
  • New parse_versioned(arena, source, version) API that emits non-fatal ParseError::VersionTooLow errors for syntax requiring a higher version than targeted
  • Parsing always succeeds and produces a full AST regardless of version errors
  • 16 version gates across PHP 8.0–8.4 syntax features:
    • 8.0: match, throw expressions, nullsafe ?->, named arguments, constructor promotion
    • 8.1: enums, readonly properties/parameters, intersection types
    • 8.2: readonly class
    • 8.3: typed class constants and enum constants
    • 8.4: abstract readonly class, property hooks, asymmetric visibility, final promoted properties

PHP 8.5 Support

  • PHP 8.5 is now the default version target
  • Pipe operator (|>) gated behind PHP 8.5
  • clone($obj, [...]) with property overrides — new ExprKind::CloneWith AST node
  • Asymmetric visibility on static properties gated behind PHP 8.5

Bug Fixes

  • abstract readonly class no longer emits a spurious "cannot use 'abstract' and 'readonly' together" error (valid since PHP 8.4)
  • Typed class/enum constants now parse correctly inside class and enum bodies
  • Constructor-promoted properties with :: constant defaults no longer trigger cascading errors

Other Changes

  • build: benchmark crates and test binaries excluded from published packages
  • docs: organized documentation into structured directories
  • test: 31 tests for malformed PHP error recovery paths, 73 tests for stmt.rs coverage, integration tests for all clone() argument forms