PHPackages                             stillat/primitives - 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. stillat/primitives

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

stillat/primitives
==================

Parses strings of primitive values into a PHP array.

v2.0.0(1y ago)46.2k↓50%13MITPHP

Since Sep 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Stillat/primitives)[ Packagist](https://packagist.org/packages/stillat/primitives)[ GitHub Sponsors](https://github.com/JohnathonKoster)[ RSS](/packages/stillat-primitives/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (15)Used By (3)

[![Primitives](banner.png)](banner.png)

This library provides a simple way to convert a string of simple values to their PHP runtime equivalents.

This library will parse the following types of values:

- Numbers
- Strings
- Arrays
- Associative arrays
- true, false, null
- Built-in PHP constants

Unknown types will return `null` as their value.

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

[](#installation)

This library can be installed with composer:

```
composer require stillat/primitives

```

Example Usage
-------------

[](#example-usage)

To use the library, create a new instance of the `Parser` class and call the `parseString` method:

```
