3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Example { public function foo() { show_backtrace(); } } function show_backtrace() { echo "No options:\n"; print_r(debug_backtrace(0)); echo "\n\nObject:\n"; print_r(debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT)); echo "\n\nNo args:\n"; print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)); echo "\n\nObject, no args:\n"; print_r(debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS)); } $e = new Example(); $e->foo();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qj87i
function name:  (null)
number of ops:  6
compiled vars:  !0 = $e
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   18     0  E >   NEW                                                  $1      'Example'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   19     3        INIT_METHOD_CALL                                             !0, 'foo'
          4        DO_FCALL                                          0          
          5      > RETURN                                                       1

Function show_backtrace:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qj87i
function name:  show_backtrace
number of ops:  29
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   ECHO                                                         'No+options%3A%0A'
    9     1        INIT_FCALL                                                   'print_r'
          2        INIT_FCALL                                                   'debug_backtrace'
          3        SEND_VAL                                                     0
          4        DO_ICALL                                             $0      
          5        SEND_VAR                                                     $0
          6        DO_ICALL                                                     
   10     7        ECHO                                                         '%0A%0AObject%3A%0A'
   11     8        INIT_FCALL                                                   'print_r'
          9        INIT_FCALL                                                   'debug_backtrace'
         10        SEND_VAL                                                     1
         11        DO_ICALL                                             $2      
         12        SEND_VAR                                                     $2
         13        DO_ICALL                                                     
   12    14        ECHO                                                         '%0A%0ANo+args%3A%0A'
   13    15        INIT_FCALL                                                   'print_r'
         16        INIT_FCALL                                                   'debug_backtrace'
         17        SEND_VAL                                                     2
         18        DO_ICALL                                             $4      
         19        SEND_VAR                                                     $4
         20        DO_ICALL                                                     
   14    21        ECHO                                                         '%0A%0AObject%2C+no+args%3A%0A'
   15    22        INIT_FCALL                                                   'print_r'
         23        INIT_FCALL                                                   'debug_backtrace'
         24        SEND_VAL                                                     3
         25        DO_ICALL                                             $6      
         26        SEND_VAR                                                     $6
         27        DO_ICALL                                                     
   16    28      > RETURN                                                       null

End of function show_backtrace

Class Example:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qj87i
function name:  foo
number of ops:  3
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL_BY_NAME                                           'show_backtrace'
          1        DO_FCALL                                          0          
          2      > RETURN                                                       null

End of function foo

End of class Example.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.22 ms | 2884 KiB | 10 Q