3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function a(): void { $_ = [1, 2, throw new Exception('a')]; echo 'unreachable!'; } function b(): void { $_ = strlen(throw new Exception('b')); echo 'unreachable!'; } function c(): void { $_ = 1 + 2 + throw new Exception('c'); echo 'unreachable!'; } try { try { try { a(); } catch (Exception) { b(); } } catch (Exception) { c(); } } catch (Exception) { echo 'done'; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 3
Branch analysis from position: 3
2 jumps found. (Code = 107) Position 1 = 4, Position 2 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Found catch point at position: 7
Branch analysis from position: 7
2 jumps found. (Code = 107) Position 1 = 8, Position 2 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Found catch point at position: 11
Branch analysis from position: 11
2 jumps found. (Code = 107) Position 1 = 12, Position 2 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nqbkU
function name:  (null)
number of ops:  14
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   INIT_FCALL                                               'a'
          1        DO_FCALL                                      0          
          2      > JMP                                                      ->6
   27     3  E > > CATCH                                       last         'Exception'
   28     4    >   INIT_FCALL                                               'b'
          5        DO_FCALL                                      0          
          6    > > JMP                                                      ->10
   30     7  E > > CATCH                                       last         'Exception'
   31     8    >   INIT_FCALL                                               'c'
          9        DO_FCALL                                      0          
         10    > > JMP                                                      ->13
   33    11  E > > CATCH                                       last         'Exception'
   34    12    >   ECHO                                                     'done'
   35    13    > > RETURN                                                   1

Function a:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/nqbkU
function name:  a
number of ops:  10
compiled vars:  !0 = $_
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_ARRAY                                       ~1      1
          1        ADD_ARRAY_ELEMENT                                ~1      2
          2        NEW                                              $2      'Exception'
          3        SEND_VAL_EX                                              'a'
          4        DO_FCALL                                      0          
          5      > THROW                                         1          $2
          6*       ADD_ARRAY_ELEMENT                                ~1      <true>
          7*       ASSIGN                                                   !0, ~1
    8     8*       ECHO                                                     'unreachable%21'
    9     9*     > RETURN                                                   null

End of function a

Function b:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/nqbkU
function name:  b
number of ops:  8
compiled vars:  !0 = $_
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   NEW                                              $1      'Exception'
          1        SEND_VAL_EX                                              'b'
          2        DO_FCALL                                      0          
          3      > THROW                                         1          $1
          4*       STRLEN                                           ~3      <true>
          5*       ASSIGN                                                   !0, ~3
   14     6*       ECHO                                                     'unreachable%21'
   15     7*     > RETURN                                                   null

End of function b

Function c:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 108) Position 1 = -2
filename:       /in/nqbkU
function name:  c
number of ops:  7
compiled vars:  !0 = $_
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $1      'Exception'
          1        SEND_VAL_EX                                              'c'
          2        DO_FCALL                                      0          
          3      > THROW                                         1          $1
          4*       ASSIGN                                                   !0, 4
   20     5*       ECHO                                                     'unreachable%21'
   21     6*     > RETURN                                                   null

End of function c

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.49 ms | 1019 KiB | 16 Q