Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6899929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:29:00+00:00 2026-05-27T07:29:00+00:00

I do lots of work manipulating and analyzing PHP code. Normally I just use

  • 0

I do lots of work manipulating and analyzing PHP code. Normally I just use the Tokenizer to do this. For most applications this is sufficient. But sometimes parsing using a lexer just isn’t reliable enough (obviously).

Thus I am looking for some PHP parser written in PHP. I found hnw/PhpParser and kumatch/stagehand-php-parser. Both are created by an automated conversion of zend_language_parser.y to a .y file with PHP instead of C (and then compiled to a LALR(1) parser). But this automated conversion just can’t be worked with.

So, is there any decent PHP parser written in PHP? (I need one for PHP 5.2 and one for 5.3. But just one of them would be a good starting point, too.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:29:01+00:00Added an answer on May 27, 2026 at 7:29 am

    After no complete and stable parser was found here I decided to write one myself. Here is the result:

    PHP-Parser: A PHP parser written in PHP

    The project supports parsing code written for any PHP version between PHP 5.2 and PHP 8.1.

    Apart from the parser itself the library provides some related components:

    • Compilation of the AST back to PHP ("pretty printing")
    • Infrastructure for traversing and changing the AST
    • Serialization to and from XML (as well as dumping in a human readable form)
    • Converting an AST into JSON and back.
    • Resolution of namespaced names (aliases etc.)

    For an usage overview see the "Usage of basic components" section of the documentation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are lots of suggested fixes for this but none of them work for
I've seen lots of descriptions how anonymous types work, but I'm not sure how
There are lots of source code formatting tools out there. Which ones work best
After inheriting some Zend Framework code it didn't work, after lots of fiddling I've
Hey guys I have done lots of work with ASIHTTPRequest so far and use
I got lots of problem to work on v.7.x,but now I have to move
I use QueueUserWorkItem() function to invoke threadpool. And I tried lots of work with
Is it bad policy to have lots of work classes(such as Strategy classes), that
I work on a 2D shooter game with lots of moving objects on the
There are lots of Fluent implementations out there now that work with Lambdas to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.