PHPackages                             axy/evil - 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. axy/evil

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

axy/evil
========

Necessary evil

0.1.0(10y ago)042211MITPHPPHP &gt;=5.4.0

Since Nov 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/axypro/evil)[ Packagist](https://packagist.org/packages/axy/evil)[ Docs](https://github.com/axypro/evil)[ RSS](/packages/axy-evil/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (1)

axy\\evil
=========

[](#axyevil)

[![Latest Stable Version](https://camo.githubusercontent.com/22398035db1a611ec3d5817efba590582bb014e5e1457b930534f0ae66b72121/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6178792f6576696c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/axy/evil)[![Minimum PHP Version](https://camo.githubusercontent.com/b52c83f3d45755ebcb1e6863ebb202ab192aaf773424369ffdeedae107f027ef/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e342d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Build Status](https://camo.githubusercontent.com/a9154dc2d042b92a8d1f9a467ca2c36c01099bcb00d1c6aab4f4f970c0fb2e61/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f61787970726f2f6576696c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/axypro/evil)[![Coverage Status](https://camo.githubusercontent.com/43dc6efefb72f41be94b667bcf79b36783afbc7b0a5f002a4daa90e8b99b79d1/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f61787970726f2f6576696c2f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/axypro/evil?branch=master)[![License](https://camo.githubusercontent.com/7d17a04f2b95e73e7cd81b1f6fb03c54e485761a90e20578769453c643a89441/68747470733a2f2f706f7365722e707567782e6f72672f6178792f6576696c2f6c6963656e7365)](LICENSE)

- The library does not require any dependencies.
- Tested on PHP 5.4+, PHP 7, HHVM (on Linux), PHP 5.5 (on Windows).
- Install: `composer require axy/evil`.
- License: [MIT](LICENSE).

### Documentation

[](#documentation)

Some language features are not recommended for frequent use. `eval()`, `exit`, global variables, direct access to super-global arrays.

But sometimes it is necessary. If you use static code analyzer, it will swear. We'll have to suppress messages.

```
/** @SuppressWarnings(PHPMD.Superglobals) */
$x = $_POST['x'];
```

This library encapsulates the "evil" features. You simply call methods and disclaims any sin.

### API

[](#api)

Classes are in the namespace `axy\evil`.

#### Evil

[](#evil)

It contains calls of "evil" functions. So how `exit`, `echo` and etc is keywords methods have other names.

##### eval - execCode

[](#eval---execcode)

```
Evil::execCode('2 + 2'); // 4
```

##### exit - stop

[](#exit---stop)

```
Evil::stop(); // exit
Evil::stop(5); // exit with code 5
```

##### breakpoint()

[](#breakpoint)

```
breakpoint(mixed $message [, bool $line [, bool $file [, int $status]);
```

Shows debugging information and terminates the current script (with the status from `$status`).

If `$message` is not a scalar then used `print_r()`.

If specified `$line`: shows the line number of the breakpoint. For `$file` shows the file name.

```
Evil::breakpoint('point'); // point
Evil::breakpoint('point', true); // 15: point
Evil::breakpoint('point', true, true); // /path/to/script.php:15: point
```

In CLI mode the `$message` completes new line. In HTTP mode the `$message` enclosed in ``.

##### echo - out

[](#echo---out)

```
Evil::out($message);
```

Sends a string to the stdout stream.

#### Superglobals

[](#superglobals)

Static methods of `axy\evil\Superglobals`:

- `getSERVER()`
- `getGET()`
- `getPOST()`
- `getREQUEST()`
- `getCOOKIE()`
- `getFILES()`
- `getSESSION()`
- `getENV()`

Return the corresponding superglobals arrays. The data is returned by reference.

```
$session = Superglobals::getSESSION();
$session['var'] = 'value'; // no effect

$session = &Supeglobals::getSESSION();
$session['var'] = 'value'; // success
```

#### Globals

[](#globals)

Static methods:

- `getGLOBALS()`: returns `$_GLOBALS` by reference
- `get($name [, $default])`: returns the value of a global variable (or `$default` if the variable not found)
- `set($name, $value)`: set
- `remove($name)`: unset

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

3842d ago

### Community

Maintainers

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

---

Top Contributors

[![vasa-c](https://avatars.githubusercontent.com/u/557081?v=4)](https://github.com/vasa-c "vasa-c (14 commits)")

### Embed Badge

![Health badge](/badges/axy-evil/health.svg)

```
[![Health](https://phpackages.com/badges/axy-evil/health.svg)](https://phpackages.com/packages/axy-evil)
```

###  Alternatives

[xethron/extended-array

Extended Array gives PHP arrays new life

105.2k](/packages/xethron-extended-array)[anilcancakir/laravel-ai-sdk-skills

A skill system for Laravel AI SDK agents. Define reusable AI capabilities with SKILL.md files.

151.1k](/packages/anilcancakir-laravel-ai-sdk-skills)

PHPackages © 2026

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