3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SomeClass { public static function someCode() { echo "1\n"; throw new Exception("E1"); } public static function some2Code() { try { echo "2\n"; throw new Exception("E2"); } catch (\Exception $e) { echo "3\n"; } } } try { try { SomeClass::someCode(); } finally { SomeClass::some2Code(); } echo "4-\n"; } catch (\Exception $e) { echo "4+".$e->getMessage()."\n"; } echo "5\n";
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 4, Position 2 = 3
Branch analysis from position: 4
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
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: 9
Branch analysis from position: 9
2 jumps found. (Code = 107) Position 1 = 10, Position 2 = -2
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ZHODL
function name:  (null)
number of ops:  17
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_STATIC_METHOD_CALL                                  'SomeClass', 'someCode'
          1        DO_FCALL                                      0          
   25     2      > FAST_CALL                                                ->4
          3    > > JMP                                                      ->7
   26     4    >   INIT_STATIC_METHOD_CALL                                  'SomeClass', 'some2Code'
          5        DO_FCALL                                      0          
          6      > FAST_RET                                                 
   28     7    >   ECHO                                                     '4-%0A'
          8      > JMP                                                      ->15
   29     9  E > > CATCH                                       last         'Exception'
   30    10    >   INIT_METHOD_CALL                                         !0, 'getMessage'
         11        DO_FCALL                                      0  $4      
         12        CONCAT                                           ~5      '4%2B', $4
         13        CONCAT                                           ~6      ~5, '%0A'
         14        ECHO                                                     ~6
   32    15    >   ECHO                                                     '5%0A'
         16      > RETURN                                                   1

Class SomeClass:
Function somecode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/ZHODL
function name:  someCode
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ECHO                                                     '1%0A'
    8     1        NEW                                              $0      'Exception'
          2        SEND_VAL_EX                                              'E1'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $0
    9     5*     > RETURN                                                   null

End of function somecode

Function some2code:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) 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/ZHODL
function name:  some2Code
number of ops:  9
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   ECHO                                                     '2%0A'
   15     1        NEW                                              $1      'Exception'
          2        SEND_VAL_EX                                              'E2'
          3        DO_FCALL                                      0          
          4      > THROW                                         0          $1
          5*       JMP                                                      ->8
   16     6  E > > CATCH                                       last         'Exception'
   17     7    >   ECHO                                                     '3%0A'
   19     8      > RETURN                                                   null

End of function some2code

End of class SomeClass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.15 ms | 1399 KiB | 13 Q