PHPackages                             andreabsferrazza/phoog - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. andreabsferrazza/phoog

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

andreabsferrazza/phoog
======================

Phoog is a lightweight PHP library offering ultra-short debugging functions for quick variable inspection. Designed for speed and zero dependencies.

v0.1.6(10mo ago)09MITPHP

Since Jun 30Pushed 10mo agoCompare

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

READMEChangelogDependenciesVersions (4)Used By (0)

Phoog – Minimal PHP Deb(oo)ugging Toolkit
=========================================

[](#phoog--minimal-php-deboougging-toolkit)

**Phoog** is a lightweight PHP library offering short-named debugging functions for quick variable inspection. Designed for speed, and zero dependencies — ideal for rapid prototyping, legacy debugging, or everyday dev workflows.

Features
--------

[](#features)

- Compact functions like `evi()`, `evid()`, `evc()`, `vip()`, etc.
- Output optimized for both HTML and CLI

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

[](#installation)

```
composer require andreabsferrazza/phoog

```

Optional: Global Shortcuts
--------------------------

[](#optional-global-shortcuts)

If you prefer to use the debug functions (`evc()`, `evi()`, etc.) without importing them in every file, you can include the helper once in your project bootstrap. To enable them, define PHOOG\_ENABLE\_HELPERS = true before loading Composer’s autoload.

```
// Before autoload
define("PHOOG_ENABLE_HELPERS", true);
require_once __DIR__ . '/vendor/autoload.php';

```

Usage
-----

[](#usage)

**⚠️ Phoog provides tools for quick diagnostics and prototyping. It is not designed for secure or high-availability production use. Global function exposure and file logging should be used with discretion.**

### vet($var); - var export true

[](#vetvar---var-export-true)

```
return var_export($var,true);

```

Example:

```
try{
    ...
}catch(Exception $e){
    ...
    echo "Var x = ".vet($x);
}

```

### vip($var); - var info pre

[](#vipvar---var-info-pre)

Wraps VET between pre tags and returns it.

### evi($var); - echo var info pre

[](#evivar---echo-var-info-pre)

`echo vip($var);`**The main function to print variables in HTML.**Example:

```
$x = 0;
$y = array( 0,1,2,3 );
evi($x);
evi($y);

```

result:

```
0
array (
  0 => 0,
  1 => 1,
  2 => 2,
  3 => 3,
)

```

### evid($var); - evi and die

[](#evidvar---evi-and-die)

Dies after echoing VIP. Example:

```
foreach($array as $k=>$v){
    ...
    if($condition) evid($v);
    ...
}

```

Prints the variable $v and dies if $condition == true

### sip($str); - string in pre

[](#sipstr---string-in-pre)

Expects a String. Returns EVI with some HTML formatting. Usually for printing out queries or text with \\n.

### esp($str); - echo string in pre

[](#espstr---echo-string-in-pre)

Expects a String. `echo sip($var);`Example:

```
$query = "SELECT *
            FROM whatever";
esp($query);

```

Prints the query with newlines.

### espd($str); - esp and die

[](#espdstr---esp-and-die)

Expects a String. Dies after echoing ESP. Example:

```
$query = "SELECT *
            FROM whatever";
espd($query);
echo $smth;

```

Prints the query with newlines and then dies, so $smth won't be echoed.

### vit($var); - var info td

[](#vitvar---var-info-td)

Wraps VET between td tags and returns it. This is for debugging in table tags, which often is a bit hefty.

### evt($var); - echo var info td

[](#evtvar---echo-var-info-td)

`echo vit($var);`

### evc($var); - echo var CLI

[](#evcvar---echo-var-cli)

`echo vet($var).PHP_EOL;`**The main function to print variables in CLI**

### evcd($var); - evc and die

[](#evcdvar---evc-and-die)

Dies after evc($var); Example:

```
$array = array(0,1,2,3,4);
evcd($array);
arsort($array);

```

Will print the array before it is sorted. Result:

```
sm@smw:~/$ php your_program.php
array (
  0 => 0,
  1 => 1,
  2 => 2,
  3 => 3,
)
sm@smw:~/$

```

### dof($var, $filename = "debug\_log.json", $incremental = true) - debug on file

[](#dofvar-filename--debug_logjson-incremental--true---debug-on-file)

Writes the contents of a variable to a JSON file. Useful when outputting to screen isn’t possible (e.g. in reports, cron jobs, or background processes).

$incremental: If true, appends each call as a new entry (default). If false, overwrites the file on each call.

Each log entry is saved as a timestamped object inside a debug array, making the file easy to parse or view in tools like Firefox.

Example

```
$data = ['user' => 'Monkey', 'role' => 'admin'];
dof($data); // Writes to debug_log.json

// Custom filename and overwrite
dof($_POST, '/tmp/my-debug.json', false);

```

#### ⚠️ Caution when using dof()

[](#️-caution-when-using-dof)

dof() writes to disk — make sure the target path ($filename) is writable and not publicly accessible via web, especially if it contains sensitive data. *Use dof() only in development environments, not in production.* Avoid dumping user data to predictable paths like /tmp/debug\_log.json without proper permissions. If $incremental is true, the log file may grow indefinitely — monitor its size in long-running systems.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance54

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

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

317d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5679eb8a688f80999a35a48bed332064acfb2601bbb65b1a557d906214f76be3?d=identicon)[andreabsferrazza](/maintainers/andreabsferrazza)

### Embed Badge

![Health badge](/badges/andreabsferrazza-phoog/health.svg)

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

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

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