3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_exception_handler(function () { $result = debug_backtrace(); var_dump($result); } ); class SomeClass { public function test() { $closure = function() {print 'Hello world'; throw new Exception();}; $closure(); } } $class = new SomeClass(); $class->test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EM1UZ
function name:  (null)
number of ops:  10
compiled vars:  !0 = $class
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'set_exception_handler'
          1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FEM1UZ%3A3%240'
    8     2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   21     4        NEW                                              $3      'SomeClass'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   22     7        INIT_METHOD_CALL                                         !0, 'test'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FEM1UZ%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EM1UZ
function name:  {closure}
number of ops:  7
compiled vars:  !0 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'debug_backtrace'
          1        DO_ICALL                                         $1      
          2        ASSIGN                                                   !0, $1
    6     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
    8     6      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FEM1UZ%3A3%240

Function %00%7Bclosure%7D%2Fin%2FEM1UZ%3A15%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/EM1UZ
function name:  {closure}
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   ECHO                                                     'Hello+world'
          1        NEW                                              $0      'Exception'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
          4*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FEM1UZ%3A15%241

Class SomeClass:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EM1UZ
function name:  test
number of ops:  5
compiled vars:  !0 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FEM1UZ%3A15%241'
          1        ASSIGN                                                   !0, ~1
   16     2        INIT_DYNAMIC_CALL                                        !0
          3        DO_FCALL                                      0          
   17     4      > RETURN                                                   null

End of function test

End of class SomeClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.92 ms | 1388 KiB | 19 Q