3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Handler { public function handle($exception) { var_dump($exception->getTrace()[0]); } } class Foo { public function bar($baz) { throw new Exception($baz); } } try { (new Foo)->bar('this is the argument'); } catch (Exception $exception) { $handler = new Handler(); $handler->handle($exception); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 6
Branch analysis from position: 6
2 jumps found. (Code = 107) Position 1 = 7, Position 2 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aYLU5
function name:  (null)
number of ops:  14
compiled vars:  !0 = $exception, !1 = $handler
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   NEW                                              $2      'Foo'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $2, 'bar'
          3        SEND_VAL_EX                                              'this+is+the+argument'
          4        DO_FCALL                                      0          
          5      > JMP                                                      ->13
   19     6  E > > CATCH                                       last         'Exception'
   20     7    >   NEW                                              $5      'Handler'
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $5
   21    10        INIT_METHOD_CALL                                         !1, 'handle'
         11        SEND_VAR_EX                                              !0
         12        DO_FCALL                                      0          
   22    13    > > RETURN                                                   1

Class Handler:
Function handle:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aYLU5
function name:  handle
number of ops:  8
compiled vars:  !0 = $exception
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'var_dump'
          2        INIT_METHOD_CALL                                         !0, 'getTrace'
          3        DO_FCALL                                      0  $1      
          4        FETCH_DIM_R                                      ~2      $1, 0
          5        SEND_VAL                                                 ~2
          6        DO_ICALL                                                 
    7     7      > RETURN                                                   null

End of function handle

End of class Handler.

Class Foo:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/aYLU5
function name:  bar
number of ops:  6
compiled vars:  !0 = $baz
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        NEW                                              $1      'Exception'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
   14     5*     > RETURN                                                   null

End of function bar

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.04 ms | 1396 KiB | 15 Q