Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getTraceAsString(Exception $ex) {
- $str = '';
- foreach($ex->getTrace() as $index => $trace) {
- $str .= "#$index {$trace['file']}({$trace['line']}): {$trace['class']}->{$trace['function']}(";
- $args = array();
- foreach($trace['args'] as $arg) {
- if (is_object($arg))
- $args[] = 'Object(' . get_class($arg) . ')';
- elseif (is_array($arg))
- $args[] = 'Array';
- else
- $args[] = var_export($arg, true);
- }
- $str .= join(', ', $args);
- $str .= ")\n";
- }
- $index++;
- $str .= "#$index {main}";
- return $str;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement