From: asidorov at hotbox dot ru
Operating system: Windows XP
PHP version: 4.3.8
PHP Bug Type: Feature/Change Request
Bug description: PHP code execution tracing
Description:
------------
The very very helpful thing would be adding trace capability to PHP to
avoid writing all this annoying var_dump's and echo's. Example output is
unsuitable ofcourse. It is provided just to show the idea. There may be
some number of output templates (full, medium, ...).
I know that there are debug_backtrace() and xDebug but those are not the
requested.
Thank you and best regards.
Reproduce code:
---------------
<?php
/* ... */
// deep - deepness of tracing function calls
// output - output file
##TRACE medium, deep(0), output('trace.txt')
// ...
for ($i=0; $i<$n; $i++) {
$a += $arr1[$i]/$arr2[$i] + foo($i);
}
// ...
##ENDTRACE
/* ... */
?>
Expected result:
----------------
trace.txt:
//for ($i=0; $i<$n; $i++) {
Init: $i=0;
Loop:
1) 0($i) < 1($n) == TRUE
//$a += $arr1[$i]/$arr2[$i+1] + foo($i);
$a = -1($a) + 3($arr1[0]) / 2($arr2[1]) + 0(foo(0)) == 0.5
2) 1($i) < 1($n) == FALSE
End loop.
//}
--
Edit bug report at http://bugs.php.net/?id=30561&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30561&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30561&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30561&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30561&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30561&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30561&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30561&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30561&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30561&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30561&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30561&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30561&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30561&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30561&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30561&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30561&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30561&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30561&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30561&r=mysqlcfg