PHPackages                             christiaan/php-sandbox - 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. [Security](/categories/security)
4. /
5. christiaan/php-sandbox

ActiveLibrary[Security](/categories/security)

christiaan/php-sandbox
======================

Php Sandbox in a child process which should make it possible to run user supplied code safely

1.0.2(13y ago)62.4k—0.8%[3 issues](https://github.com/christiaan/php-sandbox/issues)MITPHP

Since Mar 26Pushed 11y ago3 watchersCompare

[ Source](https://github.com/christiaan/php-sandbox)[ Packagist](https://packagist.org/packages/christiaan/php-sandbox)[ RSS](/packages/christiaan-php-sandbox/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (4)Used By (0)

PhpSandbox
==========

[](#phpsandbox)

[![Build Status](https://camo.githubusercontent.com/bae2b3b0c0c2dc230ef8ffcafcd87effd84ad331dc58b0af3aec6458aa8dd0fd/68747470733a2f2f7472617669732d63692e6f72672f6368726973746961616e2f7068702d73616e64626f782e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/christiaan/php-sandbox)

Php Sandbox in a child process which should make it possible to run user supplied PHP code safely.

This is a proof of concept, it works but as far as I know does not run in production anywhere. Because it runs a process for each sandbox it is also much slower than real sandbox solutions.

If you want to offer a scripting solution to your end users you are most likely better off using either the [LUA](https://github.com/laruence/php-lua) or [JavaScript V8](https://github.com/preillyme/v8js) php extensions.

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

[](#installation)

```
php composer.phar require christiaan/php-sandbox

```

Usage
-----

[](#usage)

See the various [tests](https://github.com/christiaan/php-sandbox/blob/master/tests/Christiaan/PhpSandbox/Tests)

Known issues
------------

[](#known-issues)

Does not work on Windows, most likely due to this [bug](https://bugs.php.net/bug.php?id=47918)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~0 days

Total

3

Last Release

4845d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/118490?v=4)[Christiaan Baartse](/maintainers/christiaan)[@christiaan](https://github.com/christiaan)

---

Top Contributors

[![christiaan](https://avatars.githubusercontent.com/u/118490?v=4)](https://github.com/christiaan "christiaan (27 commits)")

---

Tags

php sandbox

### Embed Badge

![Health badge](/badges/christiaan-php-sandbox/health.svg)

```
[![Health](https://phpackages.com/badges/christiaan-php-sandbox/health.svg)](https://phpackages.com/packages/christiaan-php-sandbox)
```

###  Alternatives

[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M24.9k](/packages/friendsofphp-php-cs-fixer)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.7M142](/packages/mews-purifier)[team-reflex/discord-php

An unofficial API to interact with the voice and text service Discord.

1.1k420.9k26](/packages/team-reflex-discord-php)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[nightowl/agent

NightOwl monitoring agent — collects telemetry from laravel/nightwatch and writes to PostgreSQL

771.7k](/packages/nightowl-agent)[concrete5/core

Concrete core subtree split

20166.1k50](/packages/concrete5-core)

PHPackages © 2026

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