3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($b) { if ($b) throw new Exception("e"); } function g($b) { try { f($b); $e = null; } catch (Exception $e) { } var_dump($e ? $e->getMessage() : null); } g(false); g(true);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JlQqM
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_FCALL                                               'g'
          1        SEND_VAL                                                 <false>
          2        DO_FCALL                                      0          
   22     3        INIT_FCALL                                               'g'
          4        SEND_VAL                                                 <true>
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 6
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JlQqM
function name:  f
number of ops:  7
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    5     1      > JMPZ                                                     !0, ->6
          2    >   NEW                                              $1      'Exception'
          3        SEND_VAL_EX                                              'e'
          4        DO_FCALL                                      0          
          5      > THROW                                         0          $1
    6     6    > > RETURN                                                   null

End of function f

Function g:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
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
filename:       /in/JlQqM
function name:  g
number of ops:  17
compiled vars:  !0 = $b, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
   12     1        INIT_FCALL                                               'f'
          2        SEND_VAR                                                 !0
          3        DO_FCALL                                      0          
   13     4        ASSIGN                                                   !1, null
          5      > JMP                                                      ->7
   15     6  E > > CATCH                                       last         'Exception'
   18     7    >   INIT_FCALL                                               'var_dump'
          8      > JMPZ                                                     !1, ->13
          9    >   INIT_METHOD_CALL                                         !1, 'getMessage'
         10        DO_FCALL                                      0  $4      
         11        QM_ASSIGN                                        ~5      $4
         12      > JMP                                                      ->14
         13    >   QM_ASSIGN                                        ~5      null
         14    >   SEND_VAL                                                 ~5
         15        DO_ICALL                                                 
   19    16      > RETURN                                                   null

End of function g

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.58 ms | 1407 KiB | 18 Q