3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace TestExample; class Obj1 { public function doObj1() {} } class Obj2 { public function doObj2Something() { throw new \RuntimeException('hi'); } public function doObj2SomethingElse() {} } class MainObj { private $obj1, $obj2; public function __construct(Obj1 $obj1, Obj2 $obj2) { $this->obj1 = $obj1; $this->obj2 = $obj2; } public function process() { $this->obj1->doObj1(); try { $this->obj2->doObj2Something(); } catch (\RuntimeException $e) { throw $e; } finally { $this->obj2->doObj2SomethingElse(); } } } try { $processor = new MainObj(new Obj1, new Obj2); $processor->process(); } catch (\RuntimeException $e) { var_dump($e->getMessage()); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 12
Branch analysis from position: 12
2 jumps found. (Code = 107) Position 1 = 13, Position 2 = -2
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FYn0u
function name:  (null)
number of ops:  19
compiled vars:  !0 = $processor, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   44     0  E >   NEW                                              $2      'TestExample%5CMainObj'
          1        NEW                                              $3      'TestExample%5CObj1'
          2        DO_FCALL                                      0          
          3        SEND_VAR_NO_REF_EX                                       $3
          4        NEW                                              $5      'TestExample%5CObj2'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $5
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !0, $2
   45     9        INIT_METHOD_CALL                                         !0, 'process'
         10        DO_FCALL                                      0          
         11      > JMP                                                      ->18
   48    12  E > > CATCH                                       last         'RuntimeException'
   49    13    >   INIT_NS_FCALL_BY_NAME                                    'TestExample%5Cvar_dump'
         14        INIT_METHOD_CALL                                         !1, 'getMessage'
         15        DO_FCALL                                      0  $10     
         16        SEND_VAR_NO_REF_EX                                       $10
         17        DO_FCALL                                      0          
   50    18    > > RETURN                                                   1

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

End of function doobj1

End of class TestExample\Obj1.

Class TestExample\Obj2:
Function doobj2something:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/FYn0u
function name:  doObj2Something
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $0      'RuntimeException'
          1        SEND_VAL_EX                                              'hi'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $0
   14     4*     > RETURN                                                   null

End of function doobj2something

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

End of function doobj2somethingelse

End of class TestExample\Obj2.

Class TestExample\MainObj:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FYn0u
function name:  __construct
number of ops:  7
compiled vars:  !0 = $obj1, !1 = $obj2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   24     2        ASSIGN_OBJ                                               'obj1'
          3        OP_DATA                                                  !0
   25     4        ASSIGN_OBJ                                               'obj2'
          5        OP_DATA                                                  !1
   26     6      > RETURN                                                   null

End of function __construct

Function process:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 162) Position 1 = 11, Position 2 = 10
Branch analysis from position: 11
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/FYn0u
function name:  process
number of ops:  16
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   FETCH_OBJ_R                                      ~1      'obj1'
          1        INIT_METHOD_CALL                                         ~1, 'doObj1'
          2        DO_FCALL                                      0          
   33     3        FETCH_OBJ_R                                      ~4      'obj2'
          4        INIT_METHOD_CALL                                         ~4, 'doObj2Something'
          5        DO_FCALL                                      0          
          6      > JMP                                                      ->9
   34     7  E > > CATCH                                       last         'RuntimeException'
   35     8    > > THROW                                         0          !0
   36     9    > > FAST_CALL                                                ->11
         10    > > JMP                                                      ->15
   37    11    >   FETCH_OBJ_R                                      ~6      'obj2'
         12        INIT_METHOD_CALL                                         ~6, 'doObj2SomethingElse'
         13        DO_FCALL                                      0          
         14      > FAST_RET                                                 
   39    15    > > RETURN                                                   null

End of function process

End of class TestExample\MainObj.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.56 ms | 1400 KiB | 15 Q