PHPackages                             dubcanada/php-profiler - 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. dubcanada/php-profiler

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

dubcanada/php-profiler
======================

PHP Quick Profiler Fork

11411PHP

Since Feb 22Pushed 13y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

PHP Profiler
============

[](#php-profiler)

Version 2

by Steven Surowiec

converted to Composer

by dubcanada

Introduction
------------

[](#introduction)

PHP Profiler is a fork of PHP Quick Profiler by Ryan Campbell of [Particletree](http://particletree.com/)

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

[](#installation)

Setup is very easy and straight-forward. There are five primary steps that need to be done.

1. Checkout the code into your libraries directory so that the classes can be auto loaded.
2. Instantiate Profiler\_Profiler
3. At the end of your application after all else is done call the display() method on Profiler\_Profiler.

Setup and Usage
---------------

[](#setup-and-usage)

Setting up PHP Profiler is quite simple. Below is a short code sample of the latest version.

```
$profiler = new Profiler_Profiler();
Profiler_Console::logSpeed('Start Sample run');
Profiler_Console::logMemory($object);
Profiler_Console::logSpeed('End Sample run');
$profiler->display();

```

Exceptions can also be logged:

```
try {
  // Some code goes here
}
catch (Exception $e) {
  Profiler_Console::logError($e, $e->getMessage());
}

```

Database queries can be logged as well:

```
Profiler_Console::logQuery($sql);  // Starts timer for query
$res = mysql_query($sql);
Profiler_Console::logQuery($sql);  // Ends timer for query

```

or manually

```
$start = microtime(true);
$res = mysql_query($sql);
$end = microtime(true);
Profiler_Console::logQueryManually($sql, null, $start, $end);

```

Using a custom callback to explain queries for console

```
$profiler = Profiler_Profiler(array('query_explain_callback' => array('My_Class', 'someMethod')));
Profiler_Console::logQuery($sql); // Starts timer for query
$res = mysql_query($sql);
Profiler_Console::logQuery($sql); // Ends timer for query
$profiler->display();

class My_Class {
  // $sql gets passed in with 'EXPLAIN' already added.
  public static function someMethod($sql) {
    $res = mysql_query($sql);
    return mysql_fetch_assoc($res);
  }
}

```

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

[](#configuration)

PHP Profiler lets you pass in some configuration options to help allow it to suit your own needs.

- **query\_explain\_callback** is the callback used to explain SQL queries to get additional information on them. The format used should be the same as that used by PHP's [call\_user\_func](http://us2.php.net/call_user_func) function.
- **query\_profiler\_callback** is used to integrate an extended query profiler such as [MySQL's query profiler](http://wiki.github.com/steves/PHP-Profiler/the-extended-query-profiler).

For additional documentation and code samples see the wiki.

Features
--------

[](#features)

Below are some of the features of PHP Profiler

- Log any string, array or object to the console
- Log all queries and find out how long they took to run, individually and total
- Learn which queries are being run more than once with duplicate query counting
- Allows integration with your DAL to explain executed queries
- Displays all included files
- Displays total memory usage of page load
- Log memory usage of any string, variable or object
- Log specific points in your script to see how long it takes to get to them
- See how many queries on a given page are inserts, updates, selects and deletes with query type counting

Sites Using PHP Profiler
------------------------

[](#sites-using-php-profiler)

Using PHP Profiler on your site? Let me know! If you don't want to be featured here just say so, but I still like knowing how people are using PHP Profiler so send me a message or an email and let me know.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/78399bd29862e63ef818561f9ad12290f31a9fb9b674897eca3e6e1c734d639c?d=identicon)[dubcanada](/maintainers/dubcanada)

---

Top Contributors

[![dubcanada](https://avatars.githubusercontent.com/u/120325?v=4)](https://github.com/dubcanada "dubcanada (6 commits)")

### Embed Badge

![Health badge](/badges/dubcanada-php-profiler/health.svg)

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

###  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)[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)[beyondcode/helo-laravel

HELO Laravel debug helper

90360.1k](/packages/beyondcode-helo-laravel)

PHPackages © 2026

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