Skip to content

v0.3.2

Choose a tag to compare

@jorgsowa jorgsowa released this 31 Mar 22:12
· 547 commits to main since this release

Bug Fixes

  • =& by-reference assignment$a =& $b was indistinguishable from $a = $b in the AST. AssignExpr now carries by_ref: bool.
  • &$var in array/list destructuring[&$a] / list(&$a) silently dropped the &. ArrayElement now carries by_ref: bool.
  • Empty destructuring slots[$a, , $c] empty slots were emitted as ExprKind::Null, colliding with literal null. They now emit the new ExprKind::Omit variant.
  • String parsing dead code — a branch in double-quoted string parsing would produce an empty InterpolatedString, losing the expression. Now preserved correctly.

AST Changes (php-ast)

  • AssignExpr: new by_ref: bool field (serialized only when true).
  • ArrayElement: new by_ref: bool field (serialized only when true).
  • ExprKind::Omit: new unit variant for skipped destructuring positions.

Testing

  • 8 new regression tests covering each bug.
  • Nikic fixture corpus: test both valid and invalid fixtures, fix duplicate names, version-gate PHP 8.4/8.5 fixtures.
  • Expanded edge-case coverage across PHP 8.0–8.5.

Full changelog: https://github.com/jorgsowa/rust-php-parser/blob/main/CHANGELOG.md