PHPackages                             tommyknocker/interpreter - 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. tommyknocker/interpreter

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

tommyknocker/interpreter
========================

A simple functional language interpreter in PHP

1.0.0(7mo ago)02MITPHPPHP &gt;=8.0CI passing

Since Oct 8Pushed 7mo ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

Functional Language Interpreter
===============================

[](#functional-language-interpreter)

This is a simple interpreter for a minimal functional language in PHP.

It supports:

- function calls,
- constants (numbers, strings, true, false, null),
- user-defined functions,
- nested functions.

---

Built-in Functions
------------------

[](#built-in-functions)

- `(getArg, )` — gets the i-th input argument
- `(array, ...)` — creates an array from arguments
- `(map, keys, values)` — creates an associative array (like array\_combine)
- `(concat, a, b, ...)` — concatenates strings
- `(json, expr)` — serializes expression to JSON

---

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

[](#installation)

```
git clone https://github.com/tommyknocker/interpreter.git
cd interpreter
composer install
```

or

```
composer require tommyknocker/interpreter
```

Usage Examples
--------------

[](#usage-examples)

```
