Skip to main content

parse

Function parse 

Source
pub fn parse(source: &str) -> ParseResult
Expand description

Parse PHP source with the default ParseOptions.

Returns a fully-owned ParseResult with no lifetime parameters. The internal arena is created, used, and converted within this call.

Use parse_arena when you need the raw arena-allocated AST for maximum throughput (no allocation copying).

source must be UTF-8: convert legacy-encoded files first, or read them with String::from_utf8_lossy and accept that spans after an invalid byte are shifted.