PHPackages                             naneau/php-obfuscator - 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. naneau/php-obfuscator

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

naneau/php-obfuscator
=====================

A basic but functional PHP obfuscator for object oriented PHP

0.0.5(10y ago)6023.6k184[14 issues](https://github.com/naneau/php-obfuscator/issues)[4 PRs](https://github.com/naneau/php-obfuscator/pulls)MITPHP

Since Sep 11Pushed 5y ago46 watchersCompare

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

READMEChangelogDependencies (6)Versions (6)Used By (0)

PHP Obfuscator
==============

[](#php-obfuscator)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0a974aea1442e06d9952fe35c8e7f1fdce02bbfafa9330f780db744871a1173c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6e616e6561752f7068702d6f626675736361746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/naneau/php-obfuscator/?branch=master)

This is an "obfuscator" for PSR/OOp PHP code. Different from other obfuscators, which often use a (reversible) `eval()` based obfuscation, this tool actually [parses PHP](https://github.com/nikic/PHP-Parser), and obfuscates variable names, methods, etc. This means is can not be reversed by tools such as [UnPHP](http://www.unphp.net).

This library was written out of the need to obfuscate the source for a private library which for various reasons could not be shared without steps to protect the source from prying eyes. It is not technically feasible to "encrypt" PHP source code, while retaining the option to run it on a standard PHP runtime. Tools such as [Zend Guard](http://www.zend.com/products/guard) use run-time plugins, but even these offer no real security.

While this tool does not make PHP code impossible to read, it will make it significantly less legible.

It is compatible with PHP 5.3, 5.4 and 5.5, but needs PHP 5.4+ to run.

Usage
-----

[](#usage)

After cloning this repository (`git clone https://github.com/naneau/php-obfuscator`) and installing the dependencies through Composer (`composer install`), run the following command to obfuscate a directory of PHP files:

```
./bin/obfuscate obfuscate /input/directory /output/directory
```

If you've installed this package through [Composer](https://getcomposer.org), you'll find the `obfuscate` command in the relevant [bin dir](https://getcomposer.org/doc/articles/vendor-binaries.md).

### Configuration

[](#configuration)

You may find that you'll need to prevent certain variables and methods from being renamed. In this case you can create a simple YAML configuration file

```
parameters:

    # Ignore variable names
    obfuscator.scramble_variable.ignore:
        - foo
        - bar
        - baz

    # Ignore certain methods names
    obfuscator.scramble_private_method.ignore:
        - foo
        - bar
        - baz
```

You can run the obfuscator with a configuration file through

```
./bin/obfuscate obfuscate /input/directory /output/directory --config=/foo/bar/config.yml
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity44

Moderate usage in the ecosystem

Community28

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75.7% 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 ~115 days

Total

5

Last Release

3806d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6d7b50b7ec10565e66591b3b5f81f00a499cd77a6b87564393256a8b27e03e86?d=identicon)[naneau](/maintainers/naneau)

---

Top Contributors

[![naneau](https://avatars.githubusercontent.com/u/89551?v=4)](https://github.com/naneau "naneau (28 commits)")[![gburtini](https://avatars.githubusercontent.com/u/780031?v=4)](https://github.com/gburtini "gburtini (3 commits)")[![maltethirty4](https://avatars.githubusercontent.com/u/8967456?v=4)](https://github.com/maltethirty4 "maltethirty4 (1 commits)")[![Red54](https://avatars.githubusercontent.com/u/2240638?v=4)](https://github.com/Red54 "Red54 (1 commits)")[![SamvelG](https://avatars.githubusercontent.com/u/2779831?v=4)](https://github.com/SamvelG "SamvelG (1 commits)")[![artmatsak](https://avatars.githubusercontent.com/u/5328078?v=4)](https://github.com/artmatsak "artmatsak (1 commits)")[![SikiFn](https://avatars.githubusercontent.com/u/2743862?v=4)](https://github.com/SikiFn "SikiFn (1 commits)")[![hanxue](https://avatars.githubusercontent.com/u/760008?v=4)](https://github.com/hanxue "hanxue (1 commits)")

### Embed Badge

![Health badge](/badges/naneau-php-obfuscator/health.svg)

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

###  Alternatives

[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

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