Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Tolerant Php Parser Laravel Package

microsoft/tolerant-php-parser

Tolerant PHP parser from Microsoft that builds an AST even from incomplete or syntactically invalid code. Ideal for IDEs, refactoring tools, and static analysis, with error recovery and precise source positions for tokens and nodes.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: Purpose-built for IDE scenarios requiring syntax recovery from incomplete or erroneous code (e.g., real-time editing), but unsuitable for production runtime environments due to tolerance-focused design over strict correctness. Optimized for developer tooling workflows but not general-purpose compilation.
Integration feasibility: High for PHP-centric IDE extensions via Composer, but "unknown" repository status creates dependency management risks (no version tracking, unclear release cadence). MIT license enables commercial use but lacks governance transparency.
Technical risk: Early-stage development (896 stars, 23.27 score) implies API instability, limited PHP version coverage, and unverified edge cases. Low adoption increases vendor risk with no documented maintenance roadmap or SLA. Critical gaps in PHP 8.1+/8.2+ syntax support possible.
Key questions:

  • What specific PHP versions (7.4/8.0-8.2) are officially tested and supported?
  • How does the AST structure diverge from nikic/php-parser, and what adapter layers are needed for interoperability?
  • Is there a documented stability timeline or versioning strategy (e.g., semantic versioning guarantees)?
  • What is the performance profile for codebases >50k LOC during incremental parsing?

Integration Approach

Stack fit: Ideal for PHP-based IDE extensions (e.g., VS Code plugins) using Composer. Seamless integration with PHP toolchains but incompatible with non-PHP stacks or server-side processing (e.g., CLI scripts, web servers). Requires AST compatibility checks with downstream linters/formatters.
Migration path: Start with low-risk features like syntax error highlighting using feature flags. Incrementally replace existing parsers in isolated components (e.g., diagnostics display) before expanding to refactoring. Implement adapter layers to normalize AST output differences from nikic/php-parser.
Compatibility: Must validate against target PHP versions and test edge cases (e.g., missing semicolons, unclosed blocks). Risk of breaking downstream tools if AST structure changes or unsupported syntax is encountered. Requires strict version pinning until stability is confirmed.
Sequencing:

  1. Pilot syntax error highlighting in non-critical workflows (e.g., debug builds)
  2. Benchmark performance against nikic/php-parser for real-time IDE responsiveness
  3. Expand to code completion/refactoring only after validating stability in staging environments
  4. Establish internal contribution process for critical fixes to reduce vendor dependency

Operational Impact

Maintenance: High ongoing effort due to early-stage nature; requires active monitoring of releases, manual patching for critical bugs, and internal contribution to mitigate vendor risk. No SLA necessitates dedicated team ownership for issue resolution.
Support: Limited community support (low stars) and unclear Microsoft involvement. Must build internal expertise for diagnostics handling and AST traversal. Official documentation is sparse—rely on community examples and source code exploration.
Scaling: Optimized for low-latency IDE workflows but untested at scale (>50k LOC). Avoid batch processing scenarios; benchmark for large monorepos. Incremental parsing improves performance but may strain memory with frequent partial updates.
Failure modes: Incorrect diagnostics for unsupported PHP syntax (e.g., new 8.2 features), AST structure changes breaking downstream tools, and silent failures in malformed code. Edge cases like short open tags or incomplete namespace declarations may produce invalid ASTs.
Ramp-up: Moderate learning curve for AST walking and diagnostics mapping (e.g., converting Diagnostic

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4