3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public static function bar() { self::trace(); } private static function trace() { $trace = debug_backtrace(); foreach ($trace as $step) { echo implode('', [ $step['class'], $step['type'], $step['function'] ]); } } } $foo = new Foo; $foo::bar();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UW4M6
function name:  (null)
number of ops:  7
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        FETCH_CLASS                                   0  $4      !0
          4        INIT_STATIC_METHOD_CALL                                  $4, 'bar'
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UW4M6
function name:  bar
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_STATIC_METHOD_CALL                                  'trace'
          1        DO_FCALL                                      0          
    8     2      > RETURN                                                   null

End of function bar

Function trace:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/UW4M6
function name:  trace
number of ops:  19
compiled vars:  !0 = $trace, !1 = $step
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                               'debug_backtrace'
          1        DO_ICALL                                         $2      
          2        ASSIGN                                                   !0, $2
   14     3      > FE_RESET_R                                       $4      !0, ->17
          4    > > FE_FETCH_R                                               $4, !1, ->17
   16     5    >   INIT_FCALL                                               'implode'
          6        SEND_VAL                                                 ''
   17     7        FETCH_DIM_R                                      ~5      !1, 'class'
          8        INIT_ARRAY                                       ~6      ~5
   18     9        FETCH_DIM_R                                      ~7      !1, 'type'
         10        ADD_ARRAY_ELEMENT                                ~6      ~7
   19    11        FETCH_DIM_R                                      ~8      !1, 'function'
         12        ADD_ARRAY_ELEMENT                                ~6      ~8
         13        SEND_VAL                                                 ~6
         14        DO_ICALL                                         $9      
         15        ECHO                                                     $9
   14    16      > JMP                                                      ->4
         17    >   FE_FREE                                                  $4
   22    18      > RETURN                                                   null

End of function trace

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.47 ms | 1388 KiB | 17 Q