3v4l.org

run code in 300+ PHP versions simultaneously
<?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 ); return $result['text']; } /** * 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 = ""; $expanded_args = ""; if ( isset( $frame['args'] ) ) { $args = array(); 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( [1,2,3,4,5] );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1lhtl
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  205     0  E >   INIT_STATIC_METHOD_CALL                                  'ToString', 'variable'
          1        SEND_VAL                                                 <array>
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Class ToString:
Function variable:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1lhtl
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        ASSIGN                                                   !4, $5
   19    11        FETCH_DIM_R                                      ~7      !4, 'text'
         12      > RETURN                                                   ~7
   20    13*     > RETURN                                                   null

End of function variable

Function _vartostring:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 61
Branch analysis from position: 59
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 61
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 28
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 28
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 32
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 40
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 42, Position 2 = 47
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 49, Position 2 = 56
Branch analysis from position: 49
1 jumps found. (Code = 42) Position 1 = 57
Branch analysis from position: 57
Branch analysis from position: 56
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 61
Branch analysis from position: 59
Branch analysis from position: 61
filename:       /in/1lhtl
function name:  _varToString
number of ops:  65
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                                   64          !0
          9      > JMPZ                                                     ~9, ->14
   38    10    >   CONCAT                                           ~10     '%22', !0
         11        CONCAT                                           ~11     ~10, '%22'
         12        ASSIGN                                                   !8, ~11
         13      > JMP                                                      ->57
   39    14    >   TYPE_CHECK                                  128          !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                                                      ->57
   41    28    >   TYPE_CHECK                                    2          !0
         29      > JMPZ                                                     ~16, ->32
   42    30    >   ASSIGN                                                   !8, 'NULL'
         31      > JMP                                                      ->57
   43    32    >   TYPE_CHECK                                   12          !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                                                      ->57
   45    40    >   TYPE_CHECK                                  256          !0
         41      > JMPZ                                                     ~21, ->47
   46    42    >   GET_CLASS                                        ~22     !0
         43        CONCAT                                           ~23     'Object%28+', ~22
         44        CONCAT                                           ~24     ~23, '+%29'
         45        ASSIGN                                                   !8, ~24
         46      > JMP                                                      ->57
   47    47    >   TYPE_CHECK                                  512          !0
         48      > JMPZ                                                     ~26, ->56
   48    49    >   INIT_FCALL                                               'get_resource_type'
         50        SEND_VAR                                                 !0
         51        DO_ICALL                                         $27     
         52        CONCAT                                           ~28     'Resource%28+', $27
         53        CONCAT                                           ~29     ~28, '+%29'
         54        ASSIGN                                                   !8, ~29
         55      > JMP                                                      ->57
   50    56    >   ASSIGN                                                   !8, !0
   52    57    >   TYPE_CHECK                                  128          !8
         58      > JMPZ                                                     ~32, ->61
   53    59    > > RETURN                                                   !8
         60*       JMP                                                      ->64
   55    61    >   INIT_ARRAY                                       ~33     !8, 'text'
         62        ADD_ARRAY_ELEMENT                                ~33     1, 'lines'
         63      > RETURN                                                   ~33
   57    64*     > RETURN                                                   null

End of function _vartostring

Function print_array:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 33
Branch analysis from position: 18
2 jumps found. (Code = 46) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
2 jumps found. (Code = 47) Position 1 = 25, Position 2 = 32
Branch analysis from position: 25
2 jumps found. (Code = 46) Position 1 = 27, Position 2 = 31
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 111
Branch analysis from position: 34
2 jumps found. (Code = 77) Position 1 = 43, Position 2 = 103
Branch analysis from position: 43
2 jumps found. (Code = 78) Position 1 = 44, Position 2 = 103
Branch analysis from position: 44
2 jumps found. (Code = 46) Position 1 = 75, Position 2 = 78
Branch analysis from position: 75
2 jumps found. (Code = 47) Position 1 = 79, Position 2 = 86
Branch analysis from position: 79
2 jumps found. (Code = 46) Position 1 = 81, Position 2 = 85
Branch analysis from position: 81
2 jumps found. (Code = 46) Position 1 = 87, Position 2 = 89
Branch analysis from position: 87
2 jumps found. (Code = 43) Position 1 = 90, Position 2 = 102
Branch analysis from position: 90
2 jumps found. (Code = 43) Position 1 = 92, Position 2 = 101
Branch analysis from position: 92
1 jumps found. (Code = 42) Position 1 = 103
Branch analysis from position: 103
1 jumps found. (Code = 42) Position 1 = 120
Branch analysis from position: 120
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 101
Branch analysis from position: 102
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
Branch analysis from position: 89
Branch analysis from position: 85
Branch analysis from position: 86
Branch analysis from position: 78
Branch analysis from position: 103
Branch analysis from position: 103
Branch analysis from position: 111
2 jumps found. (Code = 43) Position 1 = 114, Position 2 = 119
Branch analysis from position: 114
1 jumps found. (Code = 42) Position 1 = 120
Branch analysis from position: 120
Branch analysis from position: 119
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
Branch analysis from position: 32
Branch analysis from position: 24
Branch analysis from position: 33
Branch analysis from position: 17
filename:       /in/1lhtl
function name:  print_array
number of ops:  125
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        PRE_INC                                                  !5
   76    10        COUNT                                            ~16     !0
         11        ASSIGN                                                   !9, ~16
   78    12        ISSET_ISEMPTY_CV                                 ~18     !0
         13        BOOL_NOT                                         ~19     ~18
         14      > JMPZ_EX                                          ~19     ~19, ->17
   79    15    >   IS_SMALLER                                       ~20     !4, !2
         16        BOOL                                             ~19     ~20
         17    > > JMPZ_EX                                          ~19     ~19, ->33
   81    18    >   IS_SMALLER_OR_EQUAL                              ~21     !4, !3
         19      > JMPZ_EX                                          ~21     ~21, ->24
         20    >   ADD                                              ~22     !5, !4
         21        ADD                                              ~23     ~22, 2
         22        IS_SMALLER                                       ~24     ~23, !1
         23        BOOL                                             ~21     ~24
         24    > > JMPNZ_EX                                         ~21     ~21, ->32
   82    25    >   IS_SMALLER                                       ~25     !3, !4
         26      > JMPZ_EX                                          ~25     ~25, ->31
         27    >   ADD                                              ~26     !5, !6
         28        SUB                                              ~27     ~26, 1
         29        IS_SMALLER                                       ~28     ~27, !1
         30        BOOL                                             ~25     ~28
         31    >   BOOL                                             ~21     ~25
         32    >   BOOL                                             ~19     ~21
         33    > > JMPZ                                                     ~19, ->111
   85    34    >   ASSIGN_OP                                     1          !5, 2
   86    35        INIT_STATIC_METHOD_CALL                                  'ToString', 'indent'
         36        SEND_VAL_EX                                              '%28%0A'
         37        SEND_VAR_EX                                              !7
         38        DO_FCALL                                      0  $30     
         39        CONCAT                                           ~31     'Array%0A', $30
         40        ASSIGN                                                   !10, ~31
   87    41        PRE_INC                                                  !7
   88    42      > FE_RESET_R                                       $34     !0, ->103
         43    > > FE_FETCH_R                                       ~35     $34, !11, ->103
         44    >   ASSIGN                                                   !12, ~35
   89    45        INIT_STATIC_METHOD_CALL                                  'ToString', '_varToString'
         46        SEND_VAR                                                 !11
         47        SEND_VAR                                                 !1
         48        SEND_VAR                                                 !2
         49        SEND_VAR                                                 !3
         50        ADD                                              ~37     !4, 1
         51        SEND_VAL                                                 ~37
         52        SEND_VAR                                                 !5
         53        ADD                                              ~38     !6, !9
         54        SEND_VAL                                                 ~38
         55        ADD                                              ~39     !7, 1
         56        SEND_VAL                                                 ~39
         57        DO_FCALL                                      0  $40     
         58        ASSIGN                                                   !13, $40
   90    59        PRE_DEC                                                  !9
   91    60        FETCH_DIM_R                                      ~43     !13, 'lines'
         61        ASSIGN_OP                                     1          !5, ~43
   92    62        INIT_STATIC_METHOD_CALL                                  'ToString', 'indent'
         63        ROPE_INIT                                     3  ~46     '%5B'
         64        ROPE_ADD                                      1  ~46     ~46, !12
         65        ROPE_END                                      2  ~45     ~46, '%5D+%3D%3E+'
         66        FETCH_DIM_R                                      ~48     !13, 'text'
         67        CONCAT                                           ~49     ~45, ~48
         68        CONCAT                                           ~50     ~49, '%0A'
         69        SEND_VAL_EX                                              ~50
         70        SEND_VAR_EX                                              !7
         71        DO_FCALL                                      0  $51     
         72        ASSIGN_OP                                     8          !10, $51
   94    73        IS_SMALLER_OR_EQUAL                              ~53     !4, !3
         74      > JMPZ_EX                                          ~53     ~53, ->78
         75    >   ADD                                              ~54     !5, !4
         76        IS_SMALLER                                       ~55     !1, ~54
         77        BOOL                                             ~53     ~55
         78    > > JMPNZ_EX                                         ~53     ~53, ->86
         79    >   IS_SMALLER                                       ~56     !3, !4
         80      > JMPZ_EX                                          ~56     ~56, ->85
         81    >   ADD                                              ~57     !5, !6
         82        ADD                                              ~58     !1, !4
         83        IS_SMALLER_OR_EQUAL                              ~59     ~58, ~57
         84        BOOL                                             ~56     ~59
         85    >   BOOL                                             ~53     ~56
         86    > > JMPZ_EX                                          ~53     ~53, ->89
         87    >   IS_NOT_EQUAL                                     ~60     !9, 1
         88        BOOL                                             ~53     ~60
         89    > > JMPZ                                                     ~53, ->102
   95    90    >   IS_SMALLER                                               0, !9
         91      > JMPZ                                                     ~61, ->101
   96    92    >   INIT_STATIC_METHOD_CALL                                  'ToString', 'indent'
         93        ROPE_INIT                                     3  ~63     '...+%28'
         94        ROPE_ADD                                      1  ~63     ~63, !9
         95        ROPE_END                                      2  ~62     ~63, '%29%0A'
         96        SEND_VAL_EX                                              ~62
         97        SEND_VAR_EX                                              !7
         98        DO_FCALL                                      0  $65     
         99        ASSIGN_OP                                     8          !10, $65
   97   100        PRE_INC                                                  !5
   99   101    > > JMP                                                      ->103
   88   102    > > JMP                                                      ->43
        103    >   FE_FREE                                                  $34
  102   104        PRE_DEC                                                  !7
  103   105        INIT_STATIC_METHOD_CALL                                  'ToString', 'indent'
        106        SEND_VAL_EX                                              '%29'
        107        SEND_VAR_EX                                              !7
        108        DO_FCALL                                      0  $69     
        109        ASSIGN_OP                                     8          !10, $69
        110      > JMP                                                      ->120
  105   111    >   ISSET_ISEMPTY_CV                                 ~71     !0
        112        BOOL_NOT                                         ~72     ~71
        113      > JMPZ                                                     ~72, ->119
  106   114    >   ROPE_INIT                                     3  ~74     'Array%28'
        115        ROPE_ADD                                      1  ~74     ~74, !9
        116        ROPE_END                                      2  ~73     ~74, '%29'
        117        ASSIGN                                                   !10, ~73
        118      > JMP                                                      ->120
  108   119    >   ASSIGN                                                   !10, 'Array%28%29'
  111   120    >   INIT_ARRAY                                       ~78     !10, 'text'
        121        SUB                                              ~79     !5, !8
        122        ADD_ARRAY_ELEMENT                                ~78     ~79, 'lines'
        123      > RETURN                                                   ~78
  112   124*     > RETURN                                                   null

End of function print_array

Function indent:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 6
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 10, Position 2 = 6
Branch analysis from position: 10
Branch analysis from position: 6
filename:       /in/1lhtl
function name:  indent
number of ops:  13
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                                                      ->8
  126     6    >   ASSIGN_OP                                     8          !3, !2
  125     7        PRE_INC                                                  !4
          8    >   IS_SMALLER                                               !4, !1
          9      > JMPNZ                                                    ~9, ->6
  128    10    >   CONCAT                                           ~10     !3, !0
         11      > RETURN                                                   ~10
  129    12*     > RETURN                                                   null

End of function indent

Function exception:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 21
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/1lhtl
function name:  exception
number of ops:  41
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        GET_CLASS                                        ~7      !0
          2        ASSIGN                                                   !1, ~7
  142     3        INIT_METHOD_CALL                                         !0, 'getFile'
          4        DO_FCALL                                      0  $9      
          5        ASSIGN                                                   !2, $9
  143     6        INIT_METHOD_CALL                                         !0, 'getLine'
          7        DO_FCALL                                      0  $11     
          8        ASSIGN                                                   !3, $11
  144     9        INIT_METHOD_CALL                                         !0, 'getMessage'
         10        DO_FCALL                                      0  $13     
         11        ASSIGN                                                   !4, $13
  145    12        ASSIGN                                                   !5, ''
  146    13        INIT_METHOD_CALL                                         !0, 'getCode'
         14        DO_FCALL                                      0  $16     
         15      > JMPZ                                                     $16, ->21
  147    16    >   INIT_METHOD_CALL                                         !0, 'getCode'
         17        DO_FCALL                                      0  $17     
         18        CONCAT                                           ~18     '+and+code+%27', $17
         19        CONCAT                                           ~19     ~18, '%27'
         20        ASSIGN                                                   !5, ~19
  148    21    >   ROPE_INIT                                    11  ~22     'Exception+%27'
         22        ROPE_ADD                                      1  ~22     ~22, !1
         23        ROPE_ADD                                      2  ~22     ~22, '%27+with+message+%27'
         24        ROPE_ADD                                      3  ~22     ~22, !4
         25        ROPE_ADD                                      4  ~22     ~22, '%27'
         26        ROPE_ADD                                      5  ~22     ~22, !5
         27        ROPE_ADD                                      6  ~22     ~22, '+in+'
         28        ROPE_ADD                                      7  ~22     ~22, !2
         29        ROPE_ADD                                      8  ~22     ~22, '%3A'
         30        ROPE_ADD                                      9  ~22     ~22, !3
         31        ROPE_END                                     10  ~21     ~22, '%0AStack+trace%3A%0A%0A'
         32        ASSIGN                                                   !6, ~21
  149    33        INIT_STATIC_METHOD_CALL                                  'ToString', 'trace'
         34        INIT_METHOD_CALL                                         !0, 'getTrace'
         35        DO_FCALL                                      0  $29     
         36        SEND_VAR_NO_REF_EX                                       $29
         37        DO_FCALL                                      0  $30     
         38        ASSIGN_OP                                     8          !6, $30
  152    39      > RETURN                                                   !6
  153    40*     > RETURN                                                   null

End of function exception

Function trace:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 6
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 10
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 97
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 97
Branch analysis from position: 14
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 50
Branch analysis from position: 18
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 44
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 44
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 36, Position 2 = 42
Branch analysis from position: 36
2 jumps found. (Code = 78) Position 1 = 37, Position 2 = 42
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
Branch analysis from position: 42
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 42
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 54
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 64
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 70
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 81
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 83
Branch analysis from position: 83
2 jumps found. (Code = 43) Position 1 = 85, Position 2 = 90
Branch analysis from position: 85
1 jumps found. (Code = 42) Position 1 = 91
Branch analysis from position: 91
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 90
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 81
2 jumps found. (Code = 43) Position 1 = 85, Position 2 = 90
Branch analysis from position: 85
Branch analysis from position: 90
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 74, Position 2 = 81
Branch analysis from position: 74
Branch analysis from position: 81
Branch analysis from position: 63
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 70
Branch analysis from position: 67
Branch analysis from position: 70
Branch analysis from position: 54
2 jumps found. (Code = 43) 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: 97
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 97
Branch analysis from position: 6
filename:       /in/1lhtl
function name:  trace
number of ops:  100
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                 

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.99 ms | 1420 KiB | 15 Q