Skip to content

xepozz/stacktrace-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version Total Downloads Build status Code Coverage

Introduction

The stacktrace-parser is a tool to parse string stacktrace to array like you call getTrace() on a real exception object.

Installation

Just run in console:

composer req xepozz/stacktrace-parser --prefer-dist

Usage

use Xepozz\StacktraceParser\StacktraceParser;

$parser = new StacktraceParser();

$stacktrace = $parser->parse(<<<TEXT
Fatal error: Uncaught Exception in /in/hVvRE:5
Stack trace:
#0 /in/hVvRE(11): A->__g()
#1 {main}
  thrown in /in/hVvRE on line 5
TEXT
);

print_r($stacktrace);

Will be outputted:

Array
(
    [0] => Array
        (
            [file] => /in/hVvRE
            [line] => 11
            [class] => A
            [type] => ->
            [function] => __g
        )

)

If you want to see more examples look into tests folder

Restriction

As a lot of custom tools this tool has one restriction. It's absent args property in trace item.

It's absent, because there is no way how to reproduce reduced value back to PHP-like value.

So parser even doesn't try to restore these values.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages