PHPackages                             soundintheory/php-sql-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. soundintheory/php-sql-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

soundintheory/php-sql-parser
============================

SQL parsing tools for PHP

1.0(12y ago)21542.8k↓42.9%6[2 PRs](https://github.com/soundintheory/php-sql-parser/pulls)1BSD-2-ClausePHPPHP &gt;=5.3.3

Since Aug 9Pushed 11y ago8 watchersCompare

[ Source](https://github.com/soundintheory/php-sql-parser)[ Packagist](https://packagist.org/packages/soundintheory/php-sql-parser)[ RSS](/packages/soundintheory-php-sql-parser/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (1)

PHP SQL Parser
--------------

[](#php-sql-parser)

A fork of

A Parser for mysql-ish queries that can represent a query as an array.

Goals:
======

[](#goals)

```
1. A PSR-0 Compatible implementation
2. Improvements
3. Profit!!!

```

Usage
-----

[](#usage)

### Use your PSR-0 Compatible Autoloader or the sample one provided in example.php

[](#use-your-psr-0-compatible-autoloader-or-the-sample-one-provided-in-examplephp)

Improvements/Feedback.
----------------------

[](#improvementsfeedback)

Please send them to me, or send a pull request. I will honor every reasonable request, where reasonable usually means elegance, simplicity and bug fixes. Suggestions for improvement are welcome, though you'll see them sooner if you write them. I will take unit tests as well!

License
-------

[](#license)

PHPSQLParser is licensed under The BSD 2-Clause License, available online here:

/\*\*

- A pure PHP SQL (non validating) parser w/ focus on MySQL dialect of SQL
-
- Copyright (c) 2010-2012, Justin Swanhart
- with contributions by André Rothe &lt;, &gt;
- with contributions by Dan Vande More
-
- All rights reserved.
-
- Redistribution and use in source and binary forms, with or without modification,
- are permitted provided that the following conditions are met:
-
- - Redistributions of source code must retain the above copyright notice,
- ```
    this list of conditions and the following disclaimer.

    ```
- - Redistributions in binary form must reproduce the above copyright notice,
- ```
    this list of conditions and the following disclaimer in the documentation

    ```
- ```
    and/or other materials provided with the distribution.

    ```
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
- SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
- ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- DAMAGE. \*/

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4687d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3267058?v=4)[Sound in Theory](/maintainers/soundintheory)[@soundintheory](https://github.com/soundintheory)

---

Top Contributors

[![andyjwwhite](https://avatars.githubusercontent.com/u/3267366?v=4)](https://github.com/andyjwwhite "andyjwwhite (3 commits)")

### Embed Badge

![Health badge](/badges/soundintheory-php-sql-parser/health.svg)

```
[![Health](https://phpackages.com/badges/soundintheory-php-sql-parser/health.svg)](https://phpackages.com/packages/soundintheory-php-sql-parser)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19037.7M41](/packages/mck89-peast)[karriere/json-decoder

JsonDecoder implementation that allows you to convert your JSON data into PHP class objects

141439.4k12](/packages/karriere-json-decoder)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9642.0k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45143.1k6](/packages/jstewmc-rtf)[json-mapper/laravel-package

The JsonMapper package for Laravel

25188.9k3](/packages/json-mapper-laravel-package)[jamesmoss/toml

A parser for TOML implemented in PHP.

3231.7k15](/packages/jamesmoss-toml)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
