3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class ToString { /** * This function will convert any variable to a string representation of that variable * * @param array $var The variable to print * @param int $max_lines Maximum number of lines that can be used * @param int $max_depth Maximum depth to print * @param int $min_depth Minimum depth to print * @return string String representation of Variable */ public static function variable( $var, $max_lines = 40, $max_depth = 6, $min_depth = 2 ) { $result = ToString::_varToString( $var, $max_lines, $max_depth, $min_depth )['text']; return $result; } /** * Recursive function to print out variables much like print_r * * @param array $var The variable to print * @param int $max_lines Maximum number of lines that can be used * @param int $max_depth Maximum depth to print * @param int $min_depth Minimum depth to print * @param int $depth Current Depth * @param int $lines Current Lines Used * @param int $lines_reserved Lines reserved for previous array depth * @param int $indent How much indentation to start on * @return string String representation of Variable */ protected static function _varToString( $var, $max_lines, $max_depth, $min_depth, $depth = 0, $lines = 1, $lines_reserved = 0, $indent = 0 ) { if ( is_string( $var ) ) { $return = "\"" . $var . "\""; } elseif ( is_array( $var ) ) { $return = ToString::print_array( $var, $max_lines, $max_depth, $min_depth, $depth, $lines, $lines_reserved, $indent ); } elseif ( is_null( $var ) ) { $return = 'NULL'; } elseif ( is_bool( $var ) ) { $return = ( $var ) ? 'true' : 'false'; } elseif ( is_object( $var ) ) { $return = 'Object( '. get_class( $var ) .' )'; } elseif ( is_resource( $var ) ) { $return = 'Resource( '. get_resource_type( $var ) .' )'; } else { $return = $var; } if ( is_array( $return ) ) { return $return; } else { return array( 'text' => $return, 'lines' => 1 ); } } /** * Recursive function to print out arrays much like print_r * * @param array $array The array to print * @param int $max_lines Maximum number of lines that can be used * @param int $max_depth Maximum depth to print * @param int $min_depth Minimum depth to print * @param int $depth Current Depth * @param int $lines Current Lines Used * @param int $lines_reserved Lines reserved for previous array depth * @param int $indent How much indentation to start on * @return string String representation of Array */ protected static function print_array( $array, $max_lines, $max_depth, $min_depth, $depth, $lines, $lines_reserved, $indent ) { $start_lines = $lines; $lines++; $count = count( $array ); if ( ! empty( $array ) && $depth < $max_depth && ( ( $depth <= $min_depth && $lines + $depth + 2 < $max_lines ) || ( $depth > $min_depth && ( $lines + $lines_reserved - 1 ) < $max_lines ) ) ) { $lines += 2; $return = "Array\n" . ToString::indent( "(\n", $indent ); $indent++; foreach ( $array as $key => $value ) { $result = ToString::_varToString( $value, $max_lines, $max_depth, $min_depth, $depth + 1, $lines, $lines_reserved + $count, $indent + 1 ); $count--; $lines += $result['lines']; $return .= ToString::indent( "[$key] => ". $result['text'] ."\n", $indent ); if ( ( ( $depth <= $min_depth && ( $lines + $depth ) > $max_lines ) || ( $depth > $min_depth && ( $lines + $lines_reserved ) >= $max_lines + $depth ) ) && ( $count != 1 ) ) { if ( $count > 0 ) { $return .= ToString::indent( "... ($count)\n", $indent ); $lines++; } break; } } $indent--; $return .= ToString::indent( ")", $indent ); } else { if ( ! empty( $array ) ) { $return = "Array($count)"; } else { $return = "Array()"; } } return array( 'text' => $return, 'lines' => ( $lines - $start_lines ) ); } /** * Indent current string * * @param string $string String to indent * @param int $indent Number of Indentations * @param string $tab What a tab should look like * @return string Indented String */ protected static function indent( $string, $indent, $tab = " " ) { $pre = ''; for ( $i = 0; $i < $indent; $i++ ) { $pre .= $tab; } return $pre . $string; } /** * Converts an Exception to string * * This try's to replicate PHP's __toString for exceptions, however, it doesn't cut off * long strings and also shows variables * @param Object $e Exception Object * @return string Exception as String */ public static function exception( $e ) { $class = get_class( $e ); $file = $e->getFile(); $lineNr = $e->getLine(); $message = $e->getMessage(); $code = ""; if ( $e->getCode() ) $code = ' and code \''. $e->getCode() .'\''; $exceptionAsString = "Exception '$class' with message '$message'$code in $file:$lineNr\nStack trace:\n\n"; $exceptionAsString .= ToString::trace( $e->getTrace() ); return $exceptionAsString; } /** * Convert exception trace array to string * * @param array/object $trace Exception or trace array to convert to string * @return string String of Exception trace */ public static function trace( $trace ) { if ( is_object( $trace ) ) { $trace = $trace->getTrace(); } if ( ! is_array( $trace ) ) { return false; } $traceAsString = ""; $count = 0; foreach ( $trace as $frame ) { $args = ""; if ( isset( $frame['args'] ) ) { $args = array(); $expanded_args = ""; foreach ( $frame['args'] as $arg ) { $args[] = ToString::variable( $arg, 1 ); foreach( preg_split( "/(\n)/", ToString::variable( $arg ) ) as $line ) $expanded_args .= "# $line\n"; } $args = join( ", ", $args ); } if ( isset( $frame['file'] ) ) $format = "#%s %s(%s): %s(%s)\n%s\n\n"; else $format = "#%s [internal function]: %4\$s(%5\$s)\n%6\$s\n\n"; $traceAsString .= sprintf( $format, $count, isset( $frame['file'] ) ? $frame['file'] : 'unknown file', isset( $frame['line'] ) ? $frame['line'] : 'unknown line', ( isset( $frame['class'] ) ) ? $frame['class'].$frame['type'].$frame['function'] : $frame['function'], $args ? " $args " : "", $expanded_args ); $count++; } return $traceAsString; } } echo ToString::variable( "hello" );
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/j5VkQ
function name:  (null)
number of ops:  6
compiled vars:  none
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   NOP                                                      
 205     1        INIT_STATIC_METHOD_CALL                                  'ToString', 'variable'
         2        SEND_VAL_EX                                              'hello'
         3        DO_FCALL                                      0  $1      
         4        ECHO                                                     $1
         5      > RETURN                                                   1

Class ToString:
Function variable:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/j5VkQ
function name:  variable
number of ops:  14
compiled vars:  !0 = $var, !1 = $max_lines, !2 = $max_depth, !3 = $min_depth, !4 = $result
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  15     0  E >   RECV                                             !0      
         1        RECV_INIT                                        !1      40
         2        RECV_INIT                                        !2      6
         3        RECV_INIT                                        !3      2
  17     4        INIT_STATIC_METHOD_CALL                                  'ToString', '_varToString'
         5        SEND_VAR_EX                                              !0
         6        SEND_VAR_EX                                              !1
         7        SEND_VAR_EX                                              !2
         8        SEND_VAR_EX                                              !3
         9        DO_FCALL                                      0  $5      
        10        FETCH_DIM_R                                      $6      $5, 'text'
        11        ASSIGN                                                   !4, $6
  19    12      > RETURN                                                   !4
  20    13*     > RETURN                                                   null

End of function variable

Function _vartostring:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
Jump found. Position 1 = 59
Branch analysis from position: 59
Jump found. Position 1 = 61, Position 2 = 63
Branch analysis from position: 61
Jump found. Position 1 = -2
Branch analysis from position: 63
Jump found. Position 1 = -2
Branch analysis from position: 14
Jump found. Position 1 = 16, Position 2 = 28
Branch analysis from position: 16
Jump found. Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 28
Jump found. Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
Jump found. Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 32
Jump found. Position 1 = 34, Position 2 = 40
Branch analysis from position: 34
Jump found. Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
Jump found. Position 1 = 38
Branch analysis from position: 38
Jump found. Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 37
Jump found. Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 40
Jump found. Position 1 = 42, Position 2 = 49
Branch analysis from position: 42
Jump found. Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 49
Jump found. Position 1 = 51, Position 2 = 58
Branch analysis from position: 51
Jump found. Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 58
Jump found. Position 1 = 61, Position 2 = 63
Branch analysis from position: 61
Branch analysis from position: 63
filename:       /in/j5VkQ
function name:  _varToString
number of ops:  67
compiled vars:  !0 = $var, !1 = $max_lines, !2 = $max_depth, !3 = $min_depth, !4 = $depth, !5 = $lines, !6 = $lines_reserved, !7 = $indent, !8 = $return
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  35     0  E >   RECV                                             !0      
         1        RECV                                             !1      
         2        RECV                                             !2      
         3        RECV                                             !3      
         4        RECV_INIT                                        !4      0
         5        RECV_INIT                                        !5      1
         6        RECV_INIT                                        !6      0
         7        RECV_INIT                                        !7      0
  37     8        TYPE_CHECK                                    6  ~9      !0
         9      > JMPZ                                                     ~9, ->14
  38    10    >   CONCAT                                           ~10     '%22', !0
        11        CONCAT                                           ~11     ~10, '%22'
        12        ASSIGN                                                   !8, ~11
        13      > JMP                                                      ->59
  39    14    >   TYPE_CHECK                                    7  ~13     !0
        15      > JMPZ                                                     ~13, ->28
  40    16    >   INIT_STATIC_METHOD_CALL                                  'ToString', 'print_array'
        17        SEND_VAR_EX                                              !0
        18        SEND_VAR_EX                                              !1
        19        SEND_VAR_EX                                              !2
        20        SEND_VAR_EX                                              !3
        21        SEND_VAR_EX                                              !4
        22        SEND_VAR_EX                                              !5
        23        SEND_VAR_EX                                              !6
        24        SEND_VAR_EX                                              !7
        25        DO_FCALL                                      0  $14     
        26        ASSIGN                                                   !8, $14
        27      > JMP                                                      ->59
  41    28    >   TYPE_CHECK                                    1  ~16     !0
        29      > JMPZ                                                     ~16, ->32
  42    30    >   ASSIGN                                                   !8, 'NULL'
        31      > JMP                                                      ->59
  43    32    >   TYPE_CHECK                                   13  ~18     !0
        33      > JMPZ                                                     ~18, ->40
  44    34    > > JMPZ                                                     !0, ->37
        35    >   QM_ASSIGN                                        ~19     'true'
        36      > JMP                                                      ->38
        37    >   QM_ASSIGN                                        ~19     'false'
        38    >   ASSIGN                                                   !8, ~19
        39      > JMP                                                      ->59
  45    40    >   TYPE_CHECK                                    8  ~21     !0
        41      > JMPZ                                                     ~21, ->49
  46    42    >   INIT_FCALL                                               'get_class'
        43        SEND_VAR                                                 !0
        44        DO_ICALL                                         $22     
        45        CONCAT                                           ~23     'Object%28+', $22
        46        CONCAT                                           ~24     ~23, '+%29'
        47        ASSIGN                                                   !8, ~24
        48      > JMP                                                      ->59
  47    49    >   TYPE_CHECK                                    9  ~26     !0
        50      > JMPZ                                                     ~26, ->58
  48    51    >   INIT_FCALL                                               'get_resource_type'
        52        SEND_VAR                                                 !0
        53        DO_ICALL                                         $27     
        54        CONCAT                                           ~28     'Resource%28+', $27
        55        CONCAT                                           ~29     ~28, '+%29'
        56        ASSIGN                                                   !8, ~29
        57      > JMP                                                      ->59
  50    58    >   ASSIGN                                                   !8, !0
  52    59    >   TYPE_CHECK                                    7  ~32     !8
        60      > JMPZ                                                     ~32, ->63
  53    61    > > RETURN                                                   !8
        62*       JMP                                                      ->66
  55    63    >   INIT_ARRAY                                       ~33     !8, 'text'
        64        ADD_ARRAY_ELEMENT                                ~33     1, 'lines'
        65      > RETURN                                                   ~33
  57    66*     > RETURN                                                   null

End of function _vartostring

Function print_array:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 18, Position 2 = 20
Branch analysis from position: 18
Jump found. Position 1 = 21, Position 2 = 36
Branch analysis from position: 21
Jump found. Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
Jump found. Position 1 = 28, Position 2 = 35
Branch analysis from position: 28
Jump found. Position 1 = 30, Position 2 = 34
Branch analysis from position: 30
Jump found. Position 1 = 37, Position 2 = 118
Branch analysis from position: 37
Jump found. Position 1 = 47, Position 2 = 109
Branch analysis from position: 47
Jump found. Position 1 = 48, Position 2 = 109
Branch analysis from position: 48
Jump found. Position 1 = 80, Position 2 = 83
Branch analysis from position: 80
Jump found. Position 1 = 84, Position 2 = 91
Branch analysis from position: 84
Jump found. Position 1 = 86, Position 2 = 90
Branch analysis from position: 86
Jump found. Position 1 = 92, Position 2 = 94
Branch analysis from position: 92
Jump found. Position 1 = 95, Position 2 = 108
Branch analysis from position: 95
Jump found. Position 1 = 97, Position 2 = 107
Branch analysis from position: 97
Jump found. Position 1 = 109
Branch analysis from position: 109
Jump found. Position 1 = 127
Branch analysis from position: 127
Jump found. Position 1 = -2
Branch analysis from position: 107
Branch analysis from position: 108
Jump found. Position 1 = 47
Branch analysis from position: 47
Branch analysis from position: 94
Branch analysis from position: 90
Branch analysis from position: 91
Branch analysis from position: 83
Branch analysis from position: 109
Branch analysis from position: 109
Branch analysis from position: 118
Jump found. Position 1 = 121, Position 2 = 126
Branch analysis from position: 121
Jump found. Position 1 = 127
Branch analysis from position: 127
Branch analysis from position: 126
Jump found. Position 1 = -2
Branch analysis from position: 34
Branch analysis from position: 35
Branch analysis from position: 27
Branch analysis from position: 36
Branch analysis from position: 20
filename:       /in/j5VkQ
function name:  print_array
number of ops:  132
compiled vars:  !0 = $array, !1 = $max_lines, !2 = $max_depth, !3 = $min_depth, !4 = $depth, !5 = $lines, !6 = $lines_reserved, !7 = $indent, !8 = $start_lines, !9 = $count, !10 = $return, !11 = $value, !12 = $key, !13 = $result
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  72     0  E >   RECV                                             !0      
         1        RECV                                             !1      
         2        RECV                                             !2      
         3        RECV                                             !3      
         4        RECV                                             !4      
         5        RECV                                             !5      
         6        RECV                                             !6      
         7        RECV                                             !7      
  74     8        ASSIGN                                                   !8, !5
  75     9        POST_INC                                         ~15     !5
        10        FREE                                                     ~15
  76    11        INIT_FCALL                                               'count'
        12        SEND_VAR                                                 !0
        13        DO_ICALL                                         $16     
        14        ASSIGN                                                   !9, $16
  78    15        ISSET_ISEMPTY_VAR                           293601280  ~18     !0
        16        BOOL_NOT                                         ~19     ~18
        17      > JMPZ_EX                                          ~19     ~19, ->20
  79    18    >   IS_SMALLER                                       ~20     !4, !2
        19        BOOL                                             ~19     ~20
        20    > > JMPZ_EX                                          ~19     ~19, ->36
  81    21    >   IS_SMALLER_OR_EQUAL                              ~21     !4, !3
        22      > JMPZ_EX                                          ~21     ~21, ->27
        23    >   ADD                                              ~22     !5, !4
        24        ADD                                              ~23     ~22, 2
        25        IS_SMALLER                                       ~24     ~23, !1
        26        BOOL                                             ~21     ~24
        27    > > JMPNZ_EX                                         ~21     ~21, ->35
  82    28    >   IS_SMALLER                                       ~25     !3, !4
        29      > JMPZ_EX                                          ~25     ~25, ->34
        30    >   ADD                                              ~26     !5, !6
        31        SUB                                              ~27     ~26, 1
        32        IS_SMALLER                                       ~28     ~27, !1
        33        BOOL                                             ~25     ~28
        34    >   BOOL                                             ~21     ~25
        35    >   BOOL                                             ~19     ~21
        36    > > JMPZ                                                     ~19, ->118
  85    37    >   ASSIGN_ADD                                    0          !5, 2
  86    38        INIT_STATIC_METHOD_CALL                                  'ToString', 'indent'
        39        SEND_VAL_EX                                              '%28%0A'
        40        SEND_VAR_EX                                              !7
        41        DO_FCALL                                      0  $30     
        42        CONCAT                                           ~31     'Array%0A', $30
        43        ASSIGN                                                   !10, ~31
  87    44        POST_INC                                         ~33     !7
        45        FREE                                                     ~33
  88    46      > FE_RESET_R                                       $34     !0, ->109
        47    > > FE_FETCH_R                                       ~35     $34, !11, ->109
        48    >   ASSIGN                                                   !12, ~35
  89    49        INIT_STATIC_METHOD_CALL                                  'ToString', '_varToString'
        50        SEND_VAR_EX                                              !11
        51        SEND_VAR_EX                                              !1
        52        SEND_VAR_EX                                              !2
        53        SEND_VAR_EX                                              !3
        54        ADD                                              ~37     !4, 1
        55        SEND_VAL_EX                                              ~37
        56        SEND_VAR_EX                                              !5
        57        ADD                                              ~38     !6, !9
        58        SEND_VAL_EX                                              ~38
        59        ADD                                              ~39     !7, 1
        60        SEND_VAL_EX                                              ~39
        61        DO_FCALL                                      0  $40     
        62        ASSIGN                                                   !13, $40
  90    63        POST_DEC                                         ~42     !9
        64        FREE                                                     ~42
  91    65        FETCH_DIM_R                                      $43     !13, 'lines'
        66        ASSIGN_ADD                                    0          !5, $43
  92    67        INIT_STATIC_METHOD_CALL                                  'ToString', 'indent'
        68        ROPE_INIT                                     3  ~46     '%5B'
        69        ROPE_ADD                                      1  ~46     ~46, !12
        70        ROPE_END                                      2  ~45     ~46, '%5D+%3D%3E+'
        71        FETCH_DIM_R                                      $48     !13, 'text'
        72        CONCAT                                           ~49     ~45, $48
        73        CONCAT                                           ~50     ~49, '%0A'
        74        SEND_VAL_EX                                              ~50
        75        SEND_VAR_EX                                              !7
        76        DO_FCALL                                      0  $51     
        77        ASSIGN_CONCAT                                 0          !10, $51
  94    78        IS_SMALLER_OR_EQUAL                              ~53     !4, !3
        79      > JMPZ_EX                                          ~53     ~53, ->83
        80    >   ADD                                              ~54     !5, !4
        81        IS_SMALLER                                       ~55     !1, ~54
        82        BOOL                                             ~53     ~55
        83    > > JMPNZ_EX                                         ~53     ~53, ->91
        84    >   IS_SMALLER                                       ~56     !3, !4
        85      > JMPZ_EX                                          ~56     ~56, ->90
        86    >   ADD                                              ~57     !5, !6
        87        ADD                                              ~58     !1, !4
        88        IS_SMALLER_OR_EQUAL                              ~59     ~58, ~57
        89        BOOL                                             ~56     ~59
        90    >   BOOL                                             ~53     ~56
        91    > > JMPZ_EX                                          ~53     ~53, ->94
        92    >   IS_NOT_EQUAL                                     ~60     !9, 1
        93        BOOL                                             ~53     ~60
        94    > > JMPZ                                                     ~53, ->108
  95    95    >   IS_SMALLER                                       ~61     0, !9
        96      > JMPZ                                                     ~61, ->107
  96    97    >   INIT_STATIC_METHOD_CALL                                  'ToString', 'indent'
        98        ROPE_INIT                                     3  ~63     '...+%28'
        99        ROPE_ADD                                      1  ~63     ~63, !9
       100        ROPE_END                                      2  ~62     ~63, '%29%0A'
       101        SEND_VAL_EX                                              ~62
       102        SEND_VAR_EX                                              !7
       103        DO_FCALL                                      0  $65     
       104        ASSIGN_CONCAT                                 0          !10, $65
  97   105        POST_INC                                         ~67     !5
       106        FREE                                                     ~67
  99   107    > > JMP                                                      ->109
       108    > > JMP                                                      ->47
       109    >   FE_FREE                                                  $34
 102   110        POST_DEC                                         ~68     !7
       111        FREE                                                     ~68
 103   112        INIT_STATIC_METHOD_CALL                                  'ToString', 'indent'
       113        SEND_VAL_EX                                              '%29'
       114        SEND_VAR_EX                                              !7
       115        DO_FCALL                                      0  $69     
       116        ASSIGN_CONCAT                                 0          !10, $69
       117      > JMP                                                      ->127
 105   118    >   ISSET_ISEMPTY_VAR                           293601280  ~71     !0
       119        BOOL_NOT                                         ~72     ~71
       120      > JMPZ                                                     ~72, ->126
 106   121    >   ROPE_INIT                                     3  ~74     'Array%28'
       122        ROPE_ADD                                      1  ~74     ~74, !9
       123        ROPE_END                                      2  ~73     ~74, '%29'
       124        ASSIGN                                                   !10, ~73
       125      > JMP                                                      ->127
 108   126    >   ASSIGN                                                   !10, 'Array%28%29'
 111   127    >   INIT_ARRAY                                       ~78     !10, 'text'
       128        SUB                                              ~79     !5, !8
       129        ADD_ARRAY_ELEMENT                                ~78     ~79, 'lines'
       130      > RETURN                                                   ~78
 112   131*     > RETURN                                                   null

End of function print_array

Function indent:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 9
Branch analysis from position: 9
Jump found. Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
Jump found. Position 1 = -2
Branch analysis from position: 6
Jump found. Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
Branch analysis from position: 6
filename:       /in/j5VkQ
function name:  indent
number of ops:  14
compiled vars:  !0 = $string, !1 = $indent, !2 = $tab, !3 = $pre, !4 = $i
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
 122     0  E >   RECV                                             !0      
         1        RECV                                             !1      
         2        RECV_INIT                                        !2      '++++'
 124     3        ASSIGN                                                   !3, ''
 125     4        ASSIGN                                                   !4, 0
         5      > JMP                                                      ->9
 126     6    >   ASSIGN_CONCAT                                 0          !3, !2
 125     7        POST_INC                                         ~8      !4
         8        FREE                                                     ~8
         9    >   IS_SMALLER                                       ~9      !4, !1
        10      > JMPNZ                                                    ~9, ->6
 128    11    >   CONCAT                                           ~10     !3, !0
        12      > RETURN                                                   ~10
 129    13*     > RETURN                                                   null

End of function indent

Function exception:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
Jump found. Position 1 = -2
Branch analysis from position: 23
filename:       /in/j5VkQ
function name:  exception
number of ops:  43
compiled vars:  !0 = $e, !1 = $class, !2 = $file, !3 = $lineNr, !4 = $message, !5 = $code, !6 = $exceptionAsString
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
 139     0  E >   RECV                                             !0      
 141     1        INIT_FCALL                                               'get_class'
         2        SEND_VAR                                                 !0
         3        DO_ICALL                                         $7      
         4        ASSIGN                                                   !1, $7
 142     5        INIT_METHOD_CALL                                         !0, 'getFile'
         6        DO_FCALL                                      0  $9      
         7        ASSIGN                                                   !2, $9
 143     8        INIT_METHOD_CALL                                         !0, 'getLine'
         9        DO_FCALL                                      0  $11     
        10        ASSIGN                                                   !3, $11
 144    11        INIT_METHOD_CALL                                         !0, 'getMessage'
        12        DO_FCALL                                      0  $13     
        13        ASSIGN                                                   !4, $13
 145    14        ASSIGN                                                   !5, ''
 146    15        INIT_METHOD_CALL                                         !0, 'getCode'
        16        DO_FCALL                                      0  $16     
        17      > JMPZ                                                     $16, ->23
 147    18    >   INIT_METHOD_CALL                                         !0, 'getCode'
        19        DO_FCALL                                      0  $17     
        20        CONCAT                                           ~18     '+and+code+%27', $17
        21        CONCAT                                           ~19     ~18, '%27'
        22        ASSIGN                                                   !5, ~19
 148    23    >   ROPE_INIT                                    11  ~22     'Exception+%27'
        24        ROPE_ADD                                      1  ~22     ~22, !1
        25        ROPE_ADD                                      2  ~22     ~22, '%27+with+message+%27'
        26        ROPE_ADD                                      3  ~22     ~22, !4
        27        ROPE_ADD                                      4  ~22     ~22, '%27'
        28        ROPE_ADD                                      5  ~22     ~22, !5
        29        ROPE_ADD                                      6  ~22     ~22, '+in+'
        30        ROPE_ADD                                      7  ~22     ~22, !2
        31        ROPE_ADD                                      8  ~22     ~22, '%3A'
        32        ROPE_ADD                                      9  ~22     ~22, !3
        33        ROPE_END                                     10  ~21     ~22, '%0AStack+trace%3A%0A%0A'
        34        ASSIGN                                                   !6, ~21
 149    35        INIT_STATIC_METHOD_CALL                                  'ToString', 'trace'
        36        INIT_METHOD_CALL                                         !0, 'getTrace'
        37        DO_FCALL                                      0  $29     
        38        SEND_VAR_NO_REF                               4          $29
        39        DO_FCALL                                      0  $30     
        40        ASSIGN_CONCAT                                 0          !6, $30
 152    41      > RETURN                                                   !6
 153    42*     > RETURN                                                   null

End of function exception

Function trace:
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
Jump found. Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
Jump found. Position 1 = -2
Branch analysis from position: 10
Jump found. Position 1 = 13, Position 2 = 98
Branch analysis from position: 13
Jump found. Position 1 = 14, Position 2 = 98
Branch analysis from position: 14
Jump found. Position 1 = 17, Position 2 = 50
Branch analysis from position: 17
Jump found. Position 1 = 21, Position 2 = 44
Branch analysis from position: 21
Jump found. Position 1 = 22, Position 2 = 44
Branch analysis from position: 22
Jump found. Position 1 = 36, Position 2 = 42
Branch analysis from position: 36
Jump found. Position 1 = 37, Position 2 = 42
Branch analysis from position: 37
Jump found. Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 42
Jump found. Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 42
Branch analysis from position: 44
Jump found. Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
Jump found. Position 1 = 55
Branch analysis from position: 55
Jump found. Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
Jump found. Position 1 = 64
Branch analysis from position: 64
Jump found. Position 1 = 67, Position 2 = 70
Branch analysis from position: 67
Jump found. Position 1 = 71
Branch analysis from position: 71
Jump found. Position 1 = 74, Position 2 = 81
Branch analysis from position: 74
Jump found. Position 1 = 83
Branch analysis from position: 83
Jump found. Position 1 = 85, Position 2 = 90
Branch analysis from position: 85
Jump found. Position 1 = 91
Branch analysis from position: 91
Jump found. Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 90
Jump found. Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 81
Jump found. Position 1 = 85, Position 2 = 90
Branch analysis from position: 85
Branch analysis from position: 90
Branch analysis from position: 70
Jump found. Position 1 = 74, Position 2 = 81
Branch analysis from position: 74
Branch analysis from position: 81
Branch analysis from position: 63
Jump found. Position 1 = 67, Position 2 = 70
Branch analysis from position: 67
Branch analysis from position: 70
Branch analysis from position: 54
Jump found. Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
Branch analysis from position: 63
Branch analysis from position: 44
Branch analysis from position: 50
Branch analysis from position: 98
Jump found. Position 1 = -2
Branch analysis from position: 98
Branch analysis from position: 6
filename:       /in/j5VkQ
function name:  trace
number of ops:  101
compiled vars:  !0 = $trace, !1 = $traceAsString, !2 = $count, !3 = $frame, !4 = $args, !5 = $expanded_args, !6 = $arg, !7 = $line, !8 = $format
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
 161     0  E >   RECV                                             !0      
 163     1        TYPE_CHECK                                    8  ~9      !0
         2      > JMPZ                                                     ~9, ->6
 164     

Generated using Vulcan Logic Dumper, using php 7.2.0