PHP_FunctionCallTracer
[ class tree: PHP_FunctionCallTracer ] [ index: PHP_FunctionCallTracer ] [ all elements ]

File: FunctionCallTracer.php

Source Location: /PHP_FunctionCallTracer-1.0.0/FunctionCallTracer.php

Classes:

PHP_FunctionCallTracer
Function Call Tracer

Page Details:

Function Call Tracer

Creates a function calls debug trace. Functions arguments, returned parameters and watched variables are reported in the same section for each function call. The trace is available as an array, or can be displayed or written in a file. Traced variables can be processed by provided user functions for displaying purposes.

This package is not a replacement for full fledged PHP debuggers. It is useful for (1) remote debugging, (2) to debug a complex sequence of function calls, (3) to display non text variables in a user readable format.

(1) Remote debugging is sometimes the only option to debug a package that works fine on your system, e.g. a 32-bit OS, but breaks on a different system, e.g. a 64-bit OS, which you have no access to. A remote user who has the latter OS could run the package, then send you the trace for analysis.

(2) It is sometimes difficult not to loose track of functions calls in some live debugging sessions even with top notch PHP editor/debuggers. The trace produced by this package may come handy and is easy to use in combination with the source code to track calls and variables.

(3) Some variables native format does not always display well, typically: packed data and UTF-8 strings. They can be converted as they are being traced to a readable format by provided user functions. For example: converting binary strings to hexadecimal, or UTF-8 string to Unicode.

Fully tested with phpUnit. Code coverage test close to 100%.

Usage including trace examples is fully documented in docs/examples files.

PHP version 5

All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • The name of its contributors may not be used to endorse or promote products
derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Documentation generated on Mon, 11 Mar 2019 15:09:41 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.