already thought of a small improvement: function traceHandler ( $file = string;fullpath, $lineNumber = integer, $functionName = string, $eventIsStartOfFunction=boolean, // false = being called at exit of the function $arguments = array( '[&]$argumentVariableName' => anyVariable, .... ), $localVariables = array( 'localVariableName' => anyVariable, .... ), ADDED : $returnVariable = anyVariable // === null if $eventIsStartOfFunction===false ) { //do something }