PHPackages                             jdwx/quote - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jdwx/quote

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jdwx/quote
==========

A PHP module for handling complex quoted strings.

041PHP

Since Jun 30Pushed 10mo agoCompare

[ Source](https://github.com/jdwx/quote-php)[ Packagist](https://packagist.org/packages/jdwx/quote)[ RSS](/packages/jdwx-quote/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

jdwx/quote-php
==============

[](#jdwxquote-php)

A simple PHP module for handling quoted strings.

Installation
------------

[](#installation)

You can require it directly with Composer:

```
composer require jdwx/quote
```

Or download the source from GitHub:

Requirements
------------

[](#requirements)

This module requires PHP 8.2 or later.

Usage
-----

[](#usage)

This module provides functionality for processing arbitrary strings into lists of arguments, including support for quoting, $variable substitution, and implementing `backtick` replacement through callbacks.

A simple example using this module to get a list of arguments from a string:

```
$parser = new Parser(
    hardQuote: QuoteOperator::simple(),
    delimiter: DelimiterOperator::whitespace(),
);

var_dump( iterator_to_array( $parser( 'The "quick brown fox" jumps \'over the\' lazy dog.' ) ) );
```

Produces:

```
array(6) {
  [0] =>
  string(3) "The"
  [1] =>
  string(15) "quick brown fox"
  [2] =>
  string(5) "jumps"
  [3] =>
  string(8) "over the"
  [4] =>
  string(4) "lazy"
  [5] =>
  string(4) "dog."
}
```

A more complex example showing most of the features of this module:

```
$fnVars = new Variables( [
    'foo' => 'quick',
    'fox' => 'nope',
] );
$parser = new Parser(
    comment: QuoteOperator::cComment(),
    hardQuote: QuoteOperator::single(),
    softQuote: QuoteOperator::double(),
    strongCallback: QuoteOperator::backtick(),
    weakCallback: QuoteOperator::varCurly(),
    openCallback: OpenEndedOperator::var(),
    escape: new MultiOperator( [ new HexEscape(), new ControlCharEscape() ] ),
    delimiter: ConsolidatedDelimiterOperator::whitespace(),

    # These are the functions used by callback operators.
    fnStrong: fn( string $st ) : string => strtolower( $st ),
    fnWeak: $fnVars,
    fnOpen: $fnVars
);

$st = 'The/* slow! */ $foo    \'brown $fox\' "jumps over" \\x74he `LAZY` dog.\n';
echo Segment::mergeValues( $parser->parse( $st ) );
```

Produces:

```
The quick brown $fox jumps over the lazy dog.

```

Stability
---------

[](#stability)

This module was refactored from existing code that has been widely used in production. But then it experienced a near complete rewrite. It is considered stable and has complete test coverage.

History
-------

[](#history)

This module was refactored out of jdwx/args in June 2025.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f71b4b976170f89eac19be48c7381a27c49ed8c9cb5e8e6ff05a2ad7583efa13?d=identicon)[jdwx](/maintainers/jdwx)

---

Top Contributors

[![jdwx](https://avatars.githubusercontent.com/u/2722779?v=4)](https://github.com/jdwx "jdwx (1 commits)")

### Embed Badge

![Health badge](/badges/jdwx-quote/health.svg)

```
[![Health](https://phpackages.com/badges/jdwx-quote/health.svg)](https://phpackages.com/packages/jdwx-quote)
```

###  Alternatives

[codingyu/ueditor

UEditor extension for laravel-admin

6471.6k](/packages/codingyu-ueditor)

PHPackages © 2026

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