PHP Classes

Debug Info: Output information about variables and other data

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (8 months ago) RSS 2.0 feedNot enough user ratingsTotal: 282 All time: 7,595 This week: 455Up
Version License PHP version Categories
u4u-debug-info 1.9BSD License5.3.0PHP 5, Debug
Description 

Author

This class can output information about variables and other data.

It can take the value of a variable and outputs its type followed by the value or data structure. NULL, empty strings and boolean values are denoted in a special way.

The output is encoded depending on whether PHP is running as a Web page script or as CLI from the command line.

It may also perform other debugging tasks like measuring the time a script takes to execute, outputting debug information to file or FirePHP, throw exception when errors are triggered, get the script memory usage, etc..

Picture of Camilo Sperberg
  Performance   Level  
Name: Camilo Sperberg <contact>
Classes: 5 packages by
Country: The Netherlands The Netherlands
Age: 42
All time rank: 75620 in The Netherlands The Netherlands
Week rank: 178 Up4 in The Netherlands The Netherlands Up

Details

debugInfo.class.php ====== Credits -------- This class is made by unreal4u (Camilo Sperberg). [http://unreal4u.com/](unreal4u.com). About this class -------- * When debugging, you need sometimes to check what's in a certain variable. This class does print that information * It will have in special consideration the type of the variable you're printing: as such it will clearly indicate whether you're printing a boolean, empty string or even null * Printing to screen is not practical? Print it to a file instead * Tired of triggering errors? Convert them easily to exceptions with just one function call. From now on, every error will be converted to an exception instead * Want to know how many time or memory a functionality in your script takes? Measure several of these benchmarks easily with this class! * Format a unix timestamp? You can also do that easily with this class! Basic usage ---------- <pre>include('debugInfo.class.php'); debug($variable); </pre> * Congratulations! You have just printed something to your screen! * **Please see documentation folder for more options and advanced usage** Version History ---------- * 0.1 : * Original class * 0.2 : * Many improvements, such as: * General cleanup * Code is now more consistent * Extensively tested * 0.3 : * Changed defaults to a much better representation * More checks for debugFirePHP * 1.0 : * Integrated old class "benchmark" into this one * Some minor bug fixes * 2.0 : * Compatible with composer * Refined auto-format output Contact the author ------- * Twitter: [@unreal4u](http://twitter.com/unreal4u) * Website: [http://unreal4u.com/](http://unreal4u.com/) * Github: [http://www.github.com/unreal4u](http://www.github.com/unreal4u)

  Files folder image Files (7)  
File Role Description
Files folder imageexamples (3 files)
Files folder imagesrc (1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files (7)  /  examples  
File Role Description
  Accessible without login Plain text file complex-example.php Example Example script
  Accessible without login Plain text file simple-example.php Example Example script
  Accessible without login Plain text file simplestExample.php Example Example script

  Files folder image Files (7)  /  src  
File Role Description
Files folder imageunreal4u (2 files)

  Files folder image Files (7)  /  src  /  unreal4u  
File Role Description
  Accessible without login Plain text file auxiliar-functions.php Aux. Auxiliary script
  Accessible without login Plain text file debugInfo.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:282
This week:0
All time:7,595
This week:455Up
User Comments (1)
sufficient
11 years ago (Rahul Shambharkar)
52%StarStarStar