3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { try { throw new \RuntimeException('Test error'); } catch (\RuntimeException $e) { $error = $e; $errorClass = get_class($e); throw new $errorClass($e->getMessage()); } finally { return $error->getMessage(); } } echo test();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p1nOF
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'test'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
          3      > RETURN                                                   1

Function test:
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
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/p1nOF
function name:  test
number of ops:  24
compiled vars:  !0 = $e, !1 = $error, !2 = $errorClass
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $4      'RuntimeException'
          1        SEND_VAL_EX                                              'Test+error'
          2        DO_FCALL                                      0          
          3      > THROW                                         0          $4
          4*       JMP                                                      ->16
    6     5  E > > CATCH                                       last         'RuntimeException'
    7     6    >   ASSIGN                                                   !1, !0
    8     7        GET_CLASS                                        ~7      !0
          8        ASSIGN                                                   !2, ~7
    9     9        FETCH_CLASS                                   0  $9      !2
         10        NEW                                              $10     $9
         11        INIT_METHOD_CALL                                         !0, 'getMessage'
         12        DO_FCALL                                      0  $11     
         13        SEND_VAR_NO_REF_EX                                       $11
         14        DO_FCALL                                      0          
         15      > THROW                                         0          $10
   12    16*       FAST_CALL                                                ->18
         17*       JMP                                                      ->23
   13    18*       INIT_METHOD_CALL                                         !1, 'getMessage'
         19*       DO_FCALL                                      0  $13     
         20*       DISCARD_EXCEPTION                                        
         21*       RETURN                                                   $13
         22*       FAST_RET                                                 
   15    23*     > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.73 ms | 1399 KiB | 14 Q