// Get 3 call levels
$backTrace = "";
for ($idx = 0; $idx < 3; $idx++) {
+ // Copy array for argument analysis and init variable
$traceArray = $trace[$idx];
+ $argsString = "";
// Convert arguments type into human-readable
- $args = $traceArray['args'];
- $argsString = "";
- foreach ($args as $arg) {
- $argsString .= ", ".gettype($arg);
- }
+ foreach ($traceArray['args'] as $arg) {
+ $argsString .= ", " . gettype($arg);
+ } // END - foreach
$argsString = substr($argsString, 2);
$backTrace .= sprintf("---------- Pos %d: ----------
basename($traceArray['file']),
$traceArray['line']
);
- }
+ } // END - for
// Construct the message
$message = sprintf("--------------------------------------------------------------------------------
);
// Output the message
- print $message;
+ print($message);
+ } else {
+ // Invalid exception instance detected! Do *only* throw exceptions that
+ // extends our own exception 'FrameworkException' to get such nice
+ // outputs like above.
+ print("exceptionInstance is invalid! Please inform the core developer team.\n");
}
}