3v4l.org

run code in 300+ PHP versions simultaneously
<?php function inverse($x) { if (!$x) { throw new Exception('Деление на ноль.'); } return 1/$x; } try { return 1; echo inverse(5) . "\n"; } catch (Exception $e) { return 2; echo 'Поймано исключение: ', $e->getMessage(), "\n"; } finally { # return 3; echo "Первое finally.\n"; } try { return 4; echo inverse(0) . "\n"; } catch (Exception $e) { return 5; echo 'Поймано исключение: ', $e->getMessage(), "\n"; } finally { # return 6; echo "Второе finally.\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 162) Position 1 = 18, Position 2 = 1
Branch analysis from position: 18
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 1
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 8
Branch analysis from position: 8
2 jumps found. (Code = 107) Position 1 = 9, Position 2 = -2
Branch analysis from position: 9
2 jumps found. (Code = 162) Position 1 = 18, Position 2 = 10
Branch analysis from position: 18
Branch analysis from position: 10
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 28
Branch analysis from position: 28
2 jumps found. (Code = 107) Position 1 = 29, Position 2 = -2
Branch analysis from position: 29
2 jumps found. (Code = 162) Position 1 = 38, Position 2 = 30
Branch analysis from position: 38
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 30
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OTMFD
function name:  (null)
number of ops:  41
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > FAST_CALL                                                ->18
          1    > > RETURN                                                   1
   11     2*       INIT_FCALL                                               'inverse'
          3*       SEND_VAL                                                 5
          4*       DO_FCALL                                      0  $2      
          5*       CONCAT                                           ~3      $2, '%0A'
          6*       ECHO                                                     ~3
          7*       JMP                                                      ->16
   13     8  E > > CATCH                                       last         'Exception'
   14     9    > > FAST_CALL                                                ->18
         10    > > RETURN                                                   2
   15    11*       ECHO                                                     '%D0%9F%D0%BE%D0%B9%D0%BC%D0%B0%D0%BD%D0%BE+%D0%B8%D1%81%D0%BA%D0%BB%D1%8E%D1%87%D0%B5%D0%BD%D0%B8%D0%B5%3A+'
         12*       INIT_METHOD_CALL                                         !0, 'getMessage'
         13*       DO_FCALL                                      0  $4      
         14*       ECHO                                                     $4
         15*       ECHO                                                     '%0A'
   17    16*       FAST_CALL                                                ->18
         17*       JMP                                                      ->20
   19    18    >   ECHO                                                     '%D0%9F%D0%B5%D1%80%D0%B2%D0%BE%D0%B5+finally.%0A'
         19      > FAST_RET                                                 
   24    20*       FAST_CALL                                                ->38
         21*       RETURN                                                   4
   25    22*       INIT_FCALL                                               'inverse'
         23*       SEND_VAL                                                 0
         24*       DO_FCALL                                      0  $6      
         25*       CONCAT                                           ~7      $6, '%0A'
         26*       ECHO                                                     ~7
         27*       JMP                                                      ->36
   27    28  E > > CATCH                                       last         'Exception'
   28    29    > > FAST_CALL                                                ->38
         30    > > RETURN                                                   5
   29    31*       ECHO                                                     '%D0%9F%D0%BE%D0%B9%D0%BC%D0%B0%D0%BD%D0%BE+%D0%B8%D1%81%D0%BA%D0%BB%D1%8E%D1%87%D0%B5%D0%BD%D0%B8%D0%B5%3A+'
         32*       INIT_METHOD_CALL                                         !0, 'getMessage'
         33*       DO_FCALL                                      0  $8      
         34*       ECHO                                                     $8
         35*       ECHO                                                     '%0A'
   31    36*       FAST_CALL                                                ->38
         37*       JMP                                                      ->40
   33    38    >   ECHO                                                     '%D0%92%D1%82%D0%BE%D1%80%D0%BE%D0%B5+finally.%0A'
         39      > FAST_RET                                                 
   35    40*     > RETURN                                                   1

Function inverse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OTMFD
function name:  inverse
number of ops:  10
compiled vars:  !0 = $x
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        BOOL_NOT                                         ~1      !0
          2      > JMPZ                                                     ~1, ->7
    4     3    >   NEW                                              $2      'Exception'
          4        SEND_VAL_EX                                              '%D0%94%D0%B5%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5+%D0%BD%D0%B0+%D0%BD%D0%BE%D0%BB%D1%8C.'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
    6     7    >   DIV                                              ~4      1, !0
          8      > RETURN                                                   ~4
    7     9*     > RETURN                                                   null

End of function inverse

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.7 ms | 1403 KiB | 15 Q