3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { private $currentError; function repeateError($e) { $this->currentError = $e; $errorClass = get_class($e); throw new $errorClass($e->getMessage()); } public function show() { try { throw new \RuntimeException('Test error'); } catch (\RuntimeException $e) { $this->repeateError($e); } finally { return 'test'; } } } $test = new Test(); echo $test->show();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hreGK
function name:  (null)
number of ops:  7
compiled vars:  !0 = $test
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_METHOD_CALL                                         !0, 'show'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Class Test:
Function repeateerror:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/hreGK
function name:  repeateError
number of ops:  13
compiled vars:  !0 = $e, !1 = $errorClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    7     1        ASSIGN_OBJ                                               'currentError'
          2        OP_DATA                                                  !0
    8     3        GET_CLASS                                        ~3      !0
          4        ASSIGN                                                   !1, ~3
    9     5        FETCH_CLASS                                   0  $5      !1
          6        NEW                                              $6      $5
          7        INIT_METHOD_CALL                                         !0, 'getMessage'
          8        DO_FCALL                                      0  $7      
          9        SEND_VAR_NO_REF_EX                                       $7
         10        DO_FCALL                                      0          
         11      > THROW                                         0          $6
   10    12*     > RETURN                                                   null

End of function repeateerror

Function show:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
Found catch point at position: 5
Branch analysis from position: 5
2 jumps found. (Code = 107) Position 1 = 6, Position 2 = -2
Branch analysis from position: 6
2 jumps found. (Code = 162) Position 1 = 11, Position 2 = 10
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hreGK
function name:  show
number of ops:  15
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   NEW                                              $2      'RuntimeException'
          1        SEND_VAL_EX                                              'Test+error'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $2
          4*       JMP                                                      ->9
   16     5  E > > CATCH                                       last         'RuntimeException'
   17     6    >   INIT_METHOD_CALL                                         'repeateError'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
   19     9      > FAST_CALL                                                ->11
         10    > > JMP                                                      ->14
   20    11    >   DISCARD_EXCEPTION                                        
         12      > RETURN                                                   'test'
         13*       FAST_RET                                                 
   22    14    > > RETURN                                                   null

End of function show

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.94 ms | 1007 KiB | 13 Q