3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_exception_handler(function () { $result = debug_backtrace(); var_dump($result); $reflectionFunction = new ReflectionFunction('Closure$SomeClass::test()'); } ); 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/W5pNt
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%2FW5pNt%3A3%240'
    9     2        SEND_VAL                                                 ~1
          3        DO_ICALL                                                 
   23     4        NEW                                              $3      'SomeClass'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $3
   24     7        INIT_METHOD_CALL                                         !0, 'test'
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FW5pNt%3A3%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W5pNt
function name:  {closure}
number of ops:  11
compiled vars:  !0 = $result, !1 = $reflectionFunction
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'debug_backtrace'
          1        DO_ICALL                                         $2      
          2        ASSIGN                                                   !0, $2
    6     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
    7     6        NEW                                              $5      'ReflectionFunction'
          7        SEND_VAL_EX                                              'Closure%24SomeClass%3A%3Atest%28%29'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $5
    9    10      > RETURN                                                   null

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

Class SomeClass:
Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/W5pNt
function name:  test
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   null

End of function test

End of class SomeClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
187.49 ms | 1396 KiB | 19 Q