3v4l.org

run code in 300+ PHP versions simultaneously
<?php function inverse($x) { if (!$x) { throw new Exception('Division by zero.'); }else{ return 1/0; } } try { echo inverse(true) . "\n"; } catch (Exception $e) { echo 'Caught exception: '.__FILE__.', '.__LINE__.$e->getMessage()."\n"; } finally { echo "First finally.\n"; } try { echo inverse(false) . "\n"; } catch (Exception $e) { echo 'Caught exception: '.__FILE__.', '.__LINE__.$e->getMessage()."\n"; } finally { echo "Second finally.\n"; } // Continue execution echo "Hello World\n"; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
2 jumps found. (Code = 162) Position 1 = 14, Position 2 = 13
Branch analysis from position: 14
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 162) Position 1 = 30, Position 2 = 29
Branch analysis from position: 30
1 jumps found. (Code = 163) Position 1 = -2
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 62) 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
2 jumps found. (Code = 162) Position 1 = 14, Position 2 = 13
Branch analysis from position: 14
Branch analysis from position: 13
Found catch point at position: 22
Branch analysis from position: 22
2 jumps found. (Code = 107) Position 1 = 23, Position 2 = -2
Branch analysis from position: 23
2 jumps found. (Code = 162) Position 1 = 30, Position 2 = 29
Branch analysis from position: 30
Branch analysis from position: 29
filename:       /in/sJat2
function name:  (null)
number of ops:  34
compiled vars:  !0 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'inverse'
          1        SEND_VAL                                                 <true>
          2        DO_FCALL                                      0  $2      
          3        CONCAT                                           ~3      $2, '%0A'
          4        ECHO                                                     ~3
          5      > JMP                                                      ->12
   12     6  E > > CATCH                                       last         'Exception'
   13     7    >   INIT_METHOD_CALL                                         !0, 'getMessage'
          8        DO_FCALL                                      0  $4      
          9        CONCAT                                           ~5      'Caught+exception%3A+%2Fin%2FsJat2%2C+13', $4
         10        CONCAT                                           ~6      ~5, '%0A'
         11        ECHO                                                     ~6
   14    12    > > FAST_CALL                                                ->14
         13    > > JMP                                                      ->16
   15    14    >   ECHO                                                     'First+finally.%0A'
         15      > FAST_RET                                                 
   19    16    >   INIT_FCALL                                               'inverse'
         17        SEND_VAL                                                 <false>
         18        DO_FCALL                                      0  $8      
         19        CONCAT                                           ~9      $8, '%0A'
         20        ECHO                                                     ~9
         21      > JMP                                                      ->28
   20    22  E > > CATCH                                       last         'Exception'
   21    23    >   INIT_METHOD_CALL                                         !0, 'getMessage'
         24        DO_FCALL                                      0  $10     
         25        CONCAT                                           ~11     'Caught+exception%3A+%2Fin%2FsJat2%2C+21', $10
         26        CONCAT                                           ~12     ~11, '%0A'
         27        ECHO                                                     ~12
   22    28    > > FAST_CALL                                                ->30
         29    > > JMP                                                      ->32
   23    30    >   ECHO                                                     'Second+finally.%0A'
         31      > FAST_RET                                                 
   27    32    >   ECHO                                                     'Hello+World%0A'
   28    33      > RETURN                                                   1

Function inverse:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 8
Branch analysis from position: 3
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sJat2
function name:  inverse
number of ops:  11
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, ->8
    4     3    >   NEW                                              $2      'Exception'
          4        SEND_VAL_EX                                              'Division+by+zero.'
          5        DO_FCALL                                      0          
          6      > THROW                                         0          $2
          7*       JMP                                                      ->10
    6     8    >   DIV                                              ~4      1, 0
          9      > RETURN                                                   ~4
    8    10*     > RETURN                                                   null

End of function inverse

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.64 ms | 1403 KiB | 15 Q