PHPackages                             aheinze/scriptlite-ext - 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. aheinze/scriptlite-ext

ActivePhp-ext[Utility &amp; Helpers](/categories/utility)

aheinze/scriptlite-ext
======================

C extension for ScriptLite — high-performance ECMAScript interpreter with native C parser

0.1.2(3mo ago)24MITCPHP &gt;=8.3

Since Mar 5Pushed 3mo agoCompare

[ Source](https://github.com/aheinze/ScriptLiteExt)[ Packagist](https://packagist.org/packages/aheinze/scriptlite-ext)[ Docs](https://github.com/aheinze/ScriptLiteExt)[ RSS](/packages/aheinze-scriptlite-ext/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)DependenciesVersions (4)Used By (0)

ScriptLite C Extension
======================

[](#scriptlite-c-extension)

> **Mirror repository** — this repo is automatically mirrored from [aheinze/ScriptLite](https://github.com/aheinze/ScriptLite) for PHP PIE installation. All development, issues, and pull requests happen in the [main repository](https://github.com/aheinze/ScriptLite).

High-performance PHP extension for the [ScriptLite](https://github.com/aheinze/ScriptLite) ECMAScript interpreter. Replaces the PHP bytecode VM with a C implementation using computed-goto dispatch, delivering ~180x speedup.

The extension ships with a native C parser only (no PHP parser fallback), so no Composer autoloader or external PHP parser runtime is required at runtime.

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

[](#installation)

### Via PHP PIE (recommended)

[](#via-php-pie-recommended)

```
pie install aheinze/scriptlite-ext
```

### Manual build

[](#manual-build)

Prerequisites: PHP 8.3+ dev headers, `phpize`, C11 compiler, `libpcre2-dev`, `make`.

```
phpize
./configure --enable-scriptlite
make -j"$(nproc)"
make install
```

Then enable:

```
extension=scriptlite
```

Verify
------

[](#verify)

```
php -r "var_dump(extension_loaded('scriptlite'));"
# bool(true)

php -r "echo (new ScriptLiteExt\Engine())->eval('1 + 2');"
# 3
```

Usage
-----

[](#usage)

### Standalone (no PHP library needed)

[](#standalone-no-php-library-needed)

```
$engine = new ScriptLiteExt\Engine();
$result = $engine->eval('Math.max(1, 2, 3)');
echo $result; // 3
```

### With ScriptLite PHP library

[](#with-scriptlite-php-library)

When installed alongside `aheinze/ScriptLite`, the PHP `Engine` class automatically delegates to the C extension — no code changes needed.

```
$engine = new ScriptLite\Engine();
$result = $engine->eval('Math.max(1, 2, 3)'); // uses C extension transparently
```

API
---

[](#api)

### `ScriptLiteExt\Engine`

[](#scriptliteextengine)

MethodDescription`eval(string $code, array $globals = []): mixed`Evaluate JS code and return the result`compile(string $code): CompiledScript`Compile JS to bytecode`run(CompiledScript $script, array $globals = []): mixed`Execute compiled bytecode`transpile(string $code): string`Transpile JS to PHP code`getOutput(): string`Get captured `console.log` output### `ScriptLiteExt\Compiler`

[](#scriptliteextcompiler)

MethodDescription`compile(Program $ast): CompiledScript`Compile an AST to bytecode### `ScriptLiteExt\VirtualMachine`

[](#scriptliteextvirtualmachine)

MethodDescription`execute(CompiledScript $script, array $globals = []): mixed`Execute compiled bytecode`getOutput(): string`Get captured `console.log` outputLicense
-------

[](#license)

MIT

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance81

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

Every ~1 days

Total

3

Last Release

109d ago

### Community

Maintainers

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

---

Top Contributors

[![aheinze](https://avatars.githubusercontent.com/u/321047?v=4)](https://github.com/aheinze "aheinze (5 commits)")

### Embed Badge

![Health badge](/badges/aheinze-scriptlite-ext/health.svg)

```
[![Health](https://phpackages.com/badges/aheinze-scriptlite-ext/health.svg)](https://phpackages.com/packages/aheinze-scriptlite-ext)
```

###  Alternatives

[thefrosty/wp-utilities

A library containing my standard development resources

1716.0k17](/packages/thefrosty-wp-utilities)[dereuromark/cakephp-flash

A CakePHP plugin around powerful flash message handling.

1229.9k2](/packages/dereuromark-cakephp-flash)

PHPackages © 2026

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