PHPackages                             ntzm/icecream - 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. ntzm/icecream

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

ntzm/icecream
=============

Sweet and creamy print debugging

1.1.1(6y ago)413062MITPHPPHP ^7.2

Since Apr 26Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ntzm/icecream-php)[ Packagist](https://packagist.org/packages/ntzm/icecream)[ RSS](/packages/ntzm-icecream/feed)WikiDiscussions master Synced 3d ago

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

IceCream PHP
============

[](#icecream-php)

A PHP port of Python's [IceCream](https://github.com/gruns/icecream).

Usage
-----

[](#usage)

```
use function IceCream\ic;

function foo($i) {
    return $i + 333;
}

ic(foo(123));
// Outputs:
// ic| foo(123): 456

ic(1 + 5);
// Outputs:
// ic| 1 + 5: 6

ic(foo(123), 1 + 5);
// Outputs:
// ic| foo(123): 456, 1 + 5: 6

function bar() {
    ic();
}
bar();
// Outputs:
// ic| example.php:18 in bar()
```

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

[](#installation)

```
$ composer require --dev ntzm/icecream
```

Configuration
-------------

[](#configuration)

If you want to disable the output, you can call `IceCream::disable()`. If you want to re-enable the output, you can call `IceCream::enable()`.

If you want to change the prefix of the output, you can call `IceCream::setPrefix('myPrefix: ')` (by default the prefix is `ic| `).

If you want to change how the result is outputted, you can call `IceCream::setOutputFunction()`. For example, if you want to log your messages to a file:

```
IceCream::setOutputFunction(function (string $message): void {
    file_put_contents('log.txt', $message . PHP_EOL, FILE_APPEND);
});
```

You can reset to the default output function by calling `IceCream::resetOutputFunction()`.

Caveats
-------

[](#caveats)

- You should not call `ic` more than once per line, otherwise you will get incorrect output

```
// Don't do this
ic('foo'); ic('bar');
```

- You should not alias the `ic` function

```
// Don't do this
use function IceCream\ic as debug;
debug();
```

- You should not use the `ic` function dynamically

```
// Don't do this
$fn = 'IceCream\ic';
$fn();
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.1% 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 ~66 days

Total

3

Last Release

2443d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fdd8cc588f54db13757aeca049b5007c6d368ff16a75dcecff337d1c9399970?d=identicon)[natzim](/maintainers/natzim)

---

Top Contributors

[![ntzm](https://avatars.githubusercontent.com/u/3888578?v=4)](https://github.com/ntzm "ntzm (33 commits)")[![paigeruten](https://avatars.githubusercontent.com/u/115779?v=4)](https://github.com/paigeruten "paigeruten (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ntzm-icecream/health.svg)

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

###  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)
